File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -154,6 +154,13 @@ You can test against a Pub/Sub emulator:
154154$ gcloud beta emulators pubsub start
155155```
156156
157+ To determine which host/port the emulator is running on:
158+ ``` shell
159+ $ gcloud beta emulators pubsub env-init
160+ # Sample output:
161+ # export PUBSUB_EMULATOR_HOST=localhost:8759
162+ ```
163+
1571643 . Point your client to the emulator.
158165The code below assumes that you have set the ` host ` and ` port `
159166to the host and port the emulator is on.
@@ -168,8 +175,6 @@ ChannelProvider channelProvider =
168175 .build();
169176TopicAdminClient topicClient = TopicAdminClient . create(
170177 TopicAdminSettings . defaultBuilder(). setChannelProvider(channelProvider). build());
171- SubscriptionAdminClient subscriptionClient = SubscriptionAdminClient . create(
172- SubscriptionAdminSettings . defaultBuilder(). setChannelProvider(channelProvider). build());
173178Publisher publisher =
174179 Publisher . newBuilder(topicName). setChannelProvider(channelProvider). build();
175180```
You can’t perform that action at this time.
0 commit comments