Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void failed(Subscriber.State from, Throwable failure) {
}

private void createSubscriber() throws Exception {
// [START pubsub_pull]
// [START pubsub_subscriber_async_pull]
String projectId = "my-project-id";
String subscriptionId = "my-subscription-id";

Expand Down Expand Up @@ -129,7 +129,7 @@ public void receiveMessage(PubsubMessage message, AckReplyConsumer consumer) {
subscriber.stopAsync();
}
}
// [END pubsub_pull]
// [END pubsub_subscriber_async_pull]
}

private Subscriber createSubscriberWithErrorListener(Subscriber subscriber) throws Exception {
Expand Down Expand Up @@ -190,7 +190,7 @@ private Subscriber createSubscriberWithCustomCredentials() throws Exception {

static List<ReceivedMessage> createSubscriberWithSyncPull(
String projectId, String subscriptionId, int numOfMessages) throws Exception {
// [START subscriber_sync_pull]
// [START pubsub_subscriber_sync_pull]
SubscriberStubSettings subscriberStubSettings =
SubscriberStubSettings.newBuilder().build();
try (SubscriberStub subscriber = GrpcSubscriberStub.create(subscriberStubSettings)) {
Expand Down Expand Up @@ -223,6 +223,6 @@ static List<ReceivedMessage> createSubscriberWithSyncPull(
subscriber.acknowledgeCallable().call(acknowledgeRequest);
return pullResponse.getReceivedMessagesList();
}
// [END subscriber_sync_pull]
// [END pubsub_subscriber_sync_pull]
}
}