Interface AckReplyConsumerWithResponse
- All Known Implementing Classes:
AckReplyConsumerWithResponseImpl
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.
-
Method Summary
Modifier and TypeMethodDescriptioncom.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.
-
Method Details
-
ack
com.google.api.core.ApiFuture<AckResponse> ack()Acknowledges that the message has been successfully processed. The service will not send the message again.A future representing the server response is returned
-
nack
com.google.api.core.ApiFuture<AckResponse> nack()Signals that the message has not been successfully processed. The service should resend the message.A future representing the server response is returned
-