@@ -100,7 +100,7 @@ public void failed(Subscriber.State from, Throwable failure) {
100
100
}
101
101
102
102
private void createSubscriber () throws Exception {
103
- // [START pubsub_pull ]
103
+ // [START pubsub_subscriber_async_pull ]
104
104
String projectId = "my-project-id" ;
105
105
String subscriptionId = "my-subscription-id" ;
106
106
@@ -129,7 +129,7 @@ public void receiveMessage(PubsubMessage message, AckReplyConsumer consumer) {
129
129
subscriber .stopAsync ();
130
130
}
131
131
}
132
- // [END pubsub_pull ]
132
+ // [END pubsub_subscriber_async_pull ]
133
133
}
134
134
135
135
private Subscriber createSubscriberWithErrorListener (Subscriber subscriber ) throws Exception {
@@ -190,7 +190,7 @@ private Subscriber createSubscriberWithCustomCredentials() throws Exception {
190
190
191
191
static List <ReceivedMessage > createSubscriberWithSyncPull (
192
192
String projectId , String subscriptionId , int numOfMessages ) throws Exception {
193
- // [START subscriber_sync_pull ]
193
+ // [START pubsub_subscriber_sync_pull ]
194
194
SubscriberStubSettings subscriberStubSettings =
195
195
SubscriberStubSettings .newBuilder ().build ();
196
196
try (SubscriberStub subscriber = GrpcSubscriberStub .create (subscriberStubSettings )) {
@@ -223,6 +223,6 @@ static List<ReceivedMessage> createSubscriberWithSyncPull(
223
223
subscriber .acknowledgeCallable ().call (acknowledgeRequest );
224
224
return pullResponse .getReceivedMessagesList ();
225
225
}
226
- // [END subscriber_sync_pull ]
226
+ // [END pubsub_subscriber_sync_pull ]
227
227
}
228
228
}
0 commit comments