@@ -100,7 +100,7 @@ public void failed(Subscriber.State from, Throwable failure) {
100100 }
101101
102102 private void createSubscriber () throws Exception {
103- // [START pubsub_pull ]
103+ // [START pubsub_subscriber_async_pull ]
104104 String projectId = "my-project-id" ;
105105 String subscriptionId = "my-subscription-id" ;
106106
@@ -129,7 +129,7 @@ public void receiveMessage(PubsubMessage message, AckReplyConsumer consumer) {
129129 subscriber .stopAsync ();
130130 }
131131 }
132- // [END pubsub_pull ]
132+ // [END pubsub_subscriber_async_pull ]
133133 }
134134
135135 private Subscriber createSubscriberWithErrorListener (Subscriber subscriber ) throws Exception {
@@ -190,7 +190,7 @@ private Subscriber createSubscriberWithCustomCredentials() throws Exception {
190190
191191 static List <ReceivedMessage > createSubscriberWithSyncPull (
192192 String projectId , String subscriptionId , int numOfMessages ) throws Exception {
193- // [START subscriber_sync_pull ]
193+ // [START pubsub_subscriber_sync_pull ]
194194 SubscriberStubSettings subscriberStubSettings =
195195 SubscriberStubSettings .newBuilder ().build ();
196196 try (SubscriberStub subscriber = GrpcSubscriberStub .create (subscriberStubSettings )) {
@@ -223,6 +223,6 @@ static List<ReceivedMessage> createSubscriberWithSyncPull(
223223 subscriber .acknowledgeCallable ().call (acknowledgeRequest );
224224 return pullResponse .getReceivedMessagesList ();
225225 }
226- // [END subscriber_sync_pull ]
226+ // [END pubsub_subscriber_sync_pull ]
227227 }
228228}
0 commit comments