@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
/** * Acknowledges the messages associated with the `ack_ids` in the `AcknowledgeRequest`. The * Pub/Sub system can remove the relevant messages from the subscription. * * <p>Acknowledging a message whose ack deadline has expired may succeed, but such a message may * be redelivered later. Acknowledging a message more than once will not result in an error. * * <p>Sample code: * * <pre><code> * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); * List<String> ackIds = new ArrayList<>(); * subscriptionAdminClient.acknowledge(subscription.toString(), ackIds); * } * </code></pre> * * @param subscription The subscription whose message is being acknowledged. Format is * `projects/{project}/subscriptions/{sub}`. * @param ackIds The acknowledgment ID for the messages being acknowledged that was returned by * the Pub/Sub system in the `Pull` response. Must not be empty. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ /* package-private */ final void acknowledge(String subscription, List<String> ackIds) { AcknowledgeRequest request = AcknowledgeRequest.newBuilder().setSubscription(subscription).addAllAckIds(ackIds).build(); acknowledge(request); }
AcknowledgeRequest acknowledgeRequest = AcknowledgeRequest.newBuilder() .addAllAckIds(ackIds) .setSubscription(getSubscriptionName(context))
AcknowledgeRequest.newBuilder() .setSubscription(subscription == null ? null : subscription.toString()) .addAllAckIds(ackIds)
AcknowledgeRequest.newBuilder() .setSubscription(subscriptionName) .addAllAckIds(ackIds)
stub.acknowledgeCallable() .futureCall( AcknowledgeRequest.newBuilder() .setSubscription(subscription) .addAllAckIds(idChunk)
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() {
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() {
AcknowledgeRequest.Builder requestBuilder = AcknowledgeRequest.newBuilder() .setSubscription(cpsSubscription); final Set<String> ackIdsBatch = new HashSet<>();
private ApiFuture<Empty> ack(String subscriptionName, Collection<String> ackIds) { AcknowledgeRequest acknowledgeRequest = AcknowledgeRequest.newBuilder() .addAllAckIds(ackIds) .setSubscription(subscriptionName) .build(); return this.subscriberStub.acknowledgeCallable().futureCall(acknowledgeRequest); }
private ApiFuture<Empty> ack(String subscriptionName, Collection<String> ackIds) { AcknowledgeRequest acknowledgeRequest = AcknowledgeRequest.newBuilder() .addAllAckIds(ackIds) .setSubscription(subscriptionName) .build(); return this.subscriberStub.acknowledgeCallable().futureCall(acknowledgeRequest); }
@Override public void acknowledge(SubscriptionPath subscription, List<String> ackIds) throws IOException { AcknowledgeRequest request = AcknowledgeRequest.newBuilder() .setSubscription(subscription.getPath()) .addAllAckIds(ackIds) .build(); subscriberStub().acknowledge(request); // ignore Empty result. }