File tree Expand file tree Collapse file tree
branches/autosynth-websecurityscanner Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ refs/heads/autosynth-speech: 75d6c62a9d07d3a3642980502a25d07fbde0f232
145145refs/heads/autosynth-tasks: b0cdb991f3f75345151a3f68db1aab273dfc069b
146146refs/heads/autosynth-texttospeech: 2dcc5dc22be0f456caa1b6a8a4bcdace2641239c
147147refs/heads/autosynth-trace: db35fc1080cc51034e9c431c141cbceb53fb19c1
148- refs/heads/autosynth-websecurityscanner: f27d35d5f51ccaf06f12084dbc75f332626ffe56
148+ refs/heads/autosynth-websecurityscanner: a29a7cf422a2263b796bc21b2304701d322f0217
149149refs/heads/bigquerystorage: 06db74d123d7f8a3ef48755c2fcabed09faf8e64
150150refs/heads/elharo-patch-1: ce159ef828d3c545991ff78e7b6e0d912a9453e9
151151refs/heads/mrschmidt-numericadd: 96509abadf6190b7886d57fdd9b090da55f5171c
Original file line number Diff line number Diff line change @@ -156,50 +156,7 @@ uses the `RemoteLoggingHelper` to create a metric.
156156
157157You can test against a Pub/Sub emulator:
158158
159- 1 . [ Install Cloud SDK] ( https://cloud.google.com/sdk/downloads )
160-
161- 2 . Start the emulator:
162- ``` shell
163- $ gcloud beta emulators pubsub start
164- ```
165-
166- To determine which host/port the emulator is running on:
167- ``` shell
168- $ gcloud beta emulators pubsub env-init
169- # Sample output:
170- # export PUBSUB_EMULATOR_HOST=localhost:8759
171- ```
172-
173- 3 . Point your client to the emulator.
174- ``` java
175- String hostport = System . getenv(" PUBSUB_EMULATOR_HOST" );
176- ManagedChannel channel = ManagedChannelBuilder . forTarget(hostport). usePlaintext(true ). build();
177- try {
178- ChannelProvider channelProvider = FixedChannelProvider . create(channel);
179- CredentialsProvider credentialsProvider = new NoCredentialsProvider ();
180-
181- // Similarly for SubscriptionAdminSettings
182- TopicAdminClient topicClient = TopicAdminClient . create(
183- TopicAdminSettings
184- .defaultBuilder()
185- .setTransportProvider(
186- GrpcTransportProvider . newBuilder()
187- .setChannelProvider(channelProvider)
188- .build())
189- .setCredentialsProvider(credentialsProvider)
190- .build());
191-
192- // Similarly for Subscriber
193- Publisher publisher =
194- Publisher
195- .defaultBuilder(topicName)
196- .setChannelProvider(channelProvider)
197- .setCredentialsProvider(credentialsProvider)
198- .build();
199- } finally {
200- channel. shutdown();
201- }
202- ```
159+ 1 . [ Set up the emulator] ( https://cloud.google.com/pubsub/docs/emulator )
203160
204161### Testing code that uses Redis
205162
You can’t perform that action at this time.
0 commit comments