@BetaApi(value="This is a preview feature. For more details, see https://cloud.google.com/pubsub/docs/exactly-once-delivery.")
public interface AckReplyConsumerWithResponse
If exactly-once delivery is enabled on the subscription, the future returned by the ack/nack methods track the state of acknowledgement operation by the server. If the future completes successfully, the message is guaranteed NOT to be re-delivered. Otherwise, the future will contain an exception with more details about the failure and the message may be re-delivered.
If exactly-once delivery is NOT enabled on the subscription, the future returns immediately with an AckResponse.SUCCESS. Because re-deliveries are possible, you should ensure that your processing code is idempotent, as you may receive any given message more than once.
Modifier and Type | Method and Description |
---|---|
com.google.api.core.ApiFuture<AckResponse> |
ack()
Acknowledges that the message has been successfully processed.
|
com.google.api.core.ApiFuture<AckResponse> |
nack()
Signals that the message has not been successfully processed.
|
com.google.api.core.ApiFuture<AckResponse> ack()
A future representing the server response is returned
com.google.api.core.ApiFuture<AckResponse> nack()
A future representing the server response is returned
Copyright © 2023 Google LLC. All rights reserved.