What is the equivalent of AWS Dead Letter Queue in Google Cloud Platform? How is the failed records managed in Google Cloud Platform?
As of beginning 2020, Google Pub/Sub now supports configuring dead letter topic when creating a subscription (just like other major queueing systems):
$ gcloud pubsub subscriptions create SUBSCRIPTION \
--topic=TOPIC \
--topic_project=TOPIC_PROJECT \
--max-delivery-attempts=NUMBER_OF_RETRIES \
--dead-letter-topic=DEAD_LETTER_TOPIC \
--dead-letter-topic-project=DEAD_LETTER_TOPIC_PROJECT
After reaching the NUMBER_OF_RETRIES
the message that failed to be delivered to TOPIC
will be published to DEAD_LETTER_TOPIC
instead (which can be useful for further analysis, triggering an alert or other automated action, etc.)
As stated in the docs, the Cloud Pub/Sub service account associated with the enclosing subscription's parent project (i.e., service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com
) must have permission to Publish()
to this topic and Acknowledge()
messages on this subscription.
Docs: https://cloud.google.com/sdk/gcloud/reference/pubsub/subscriptions/create#--max-delivery-attempts
Short answer: there is none. Google PubSub is missing this core feature of every other queuing system.
Longer answer: You can try to implement a DLQ yourself, but there are several features missing from Google Pub/Sub that make it difficult to implement correctly.
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