I know that message.ack()
acknowledges a message, to prevent it being re-sent when the acknowledgement deadline has passed.
But what does message.nack()
do? What is the difference between ack and nack?
message.nack()
(that is language specific, I know not all languages use that syntax) tells Cloud Pub/Sub that this particular client cannot handle the message. The service can then send the message to another client, potentially after some backoff, where it (hopefully) will be handled successfully.