Search code examples
javagoogle-cloud-platformpublish-subscribegoogle-cloud-pubsub

How deadline exceeded messages are handled in pubsub


I have set pubsub topic configuration as following:

  1. Acknowledgement deadline 600 sec
  2. max delivery attempt 10
  3. dead letter topic is not enabled

My question is:

  1. After 10 retry attempt, if pusub does not receive ack from subscriber, does it delete message from subscription or it will still be there in subscription till message retention period but will not be consumed.
  2. And if it is there in subscription till retention period will it keep increasing oldest unacked message age

Solution

  • It is not possible to set a max delivery attempt count without setting a dead letter topic. The max delivery attempt count indicates the number of times to attempt delivery before the message is sent to the dead letter topic.

    If the dead letter topic cannot be used because it was deleted or proper publish permission has not been set up, then the message will continue to be delivered to subscribers on the original subscription until it is acknowledged, the dead letter topic is available, or the retention period has passed. In this case, the oldest unacked message age will increase until one of these things happens.