File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ refs/heads/autosynth-scheduler: d97f8743ba965c7d5e492c8dc1f51d023104e260
142142refs/heads/autosynth-securitycenter: 8e95447ccb176c3648880ee0cb926cd1f4065156
143143refs/heads/autosynth-spanner: 9bff86d057df31e04c76d72865e8e073ac5794fb
144144refs/heads/autosynth-speech: 75d6c62a9d07d3a3642980502a25d07fbde0f232
145- refs/heads/autosynth-tasks: f27d35d5f51ccaf06f12084dbc75f332626ffe56
145+ refs/heads/autosynth-tasks: a29a7cf422a2263b796bc21b2304701d322f0217
146146refs/heads/autosynth-texttospeech: 0e26ec9b0ed5bbedc038dea32bbb44bae0883668
147147refs/heads/autosynth-trace: 80c58aa2fb54b0a9c6876f2c21aa8d19cf55962e
148148refs/heads/autosynth-websecurityscanner: d4febbffb6c648b74faec62fe90e20adadc9a7d3
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