When using Amazon's SQS for example, I can define a dead letter queue (DLQ) where any message that has failed to be deleted (ack'd) after X retries will be routed to for separate processing.. but it Google Cloud Platform I don't see any mention of this
Google Cloud Pub/Sub does not currently have any automatic dead letter queues. If you are worried about "poison pill" messages, you will have to support this in some capacity yourself by persistently keeping a map from the message ID to the number of times the message has been delivered. You would update this map in your subscriber before reading the data in the message. Once acknowledged, you remove from the map. If the count exceeds some threshold, you could publish it to a separate Cloud Pub/Sub topic that you use to keep track of such messages and then ack the message.
Cloud Pub/Sub now supports Dead Letter Queues that can be used to handle poison pill messages.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With