Skip to content

Commit bdf1034

Browse files
committed
pr comment
1 parent 410aa76 commit bdf1034

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

TESTING.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff 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+
157164
3. Point your client to the emulator.
158165
The code below assumes that you have set the `host` and `port`
159166
to the host and port the emulator is on.
@@ -168,8 +175,6 @@ ChannelProvider channelProvider =
168175
.build();
169176
TopicAdminClient topicClient = TopicAdminClient.create(
170177
TopicAdminSettings.defaultBuilder().setChannelProvider(channelProvider).build());
171-
SubscriptionAdminClient subscriptionClient = SubscriptionAdminClient.create(
172-
SubscriptionAdminSettings.defaultBuilder().setChannelProvider(channelProvider).build());
173178
Publisher publisher =
174179
Publisher.newBuilder(topicName).setChannelProvider(channelProvider).build();
175180
```

0 commit comments

Comments
 (0)