Retry Policy With A DLQ

785 views
Skip to first unread message

Jianping Roth

unread,
Mar 11, 2021, 5:29:49 AM3/11/21
to Google Cloud Pub/Sub Discussions
I have a question regarding the cloud subscription retry policy maximum delivery attempts. It didn't work for me.
 
I created a cloud topic, a dead letter topic and push subscription using a CloudRun. 
The subscription is associated the DLQ and the maximum delivery attempts is 5. I also created a default subscription on the DLQ.

I then published a message containing invalid data to test the maximum delivery attempts. The invalid data caused an exception in the CloudRun. The message was then retried forever (or until the end of the message retention) even though the message was also  published to the DLQ.

My question is how I can make my subscription retry a message for more or less the value I defined ?




plaj

unread,
Mar 12, 2021, 7:21:38 AM3/12/21
to Google Cloud Pub/Sub Discussions
Hi there,

Even though it is documented that the maximum number of delivery attempts is approximate because Pub/Sub forwards undeliverable messages on a best-effort basis, it doesn't seem to be right that the message is retried indefinetely until the end of message retention. 

For this reason, since the behavior is unexpected I’d advise you to open an issue with issue-tracker [2], where you’ll get updates from the product team regarding this issue.

Kamal Aboul-Hosn

unread,
Mar 12, 2021, 8:18:15 AM3/12/21
to plaj, Google Cloud Pub/Sub Discussions
It sounds like perhaps you did not grant Pub/Sub publish permission on the DLQ topicand subscribe permission on the subscription. Please verify that you set these permissions. They are required for DLQ to work as expected.

--
You received this message because you are subscribed to the Google Groups "Google Cloud Pub/Sub Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloud-pubsub-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloud-pubsub-discuss/893dc4c4-815e-4859-8589-7263eb3b73a4n%40googlegroups.com.

Jianping Roth

unread,
Mar 14, 2021, 12:41:29 PM3/14/21
to plaj, Google Cloud Pub/Sub Discussions
I want to clarify what happened: it was the incorrect setup: I didn't grant the subscriber permission and so the subscription is unable to remove the request

gcloud pubsub subscriptions add-iam-policy-binding ${topic} \
--member=serviceAccount:${serviceAccount} \
--role=roles/pubsub.subscriber

--
You received this message because you are subscribed to the Google Groups "Google Cloud Pub/Sub Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloud-pubsub-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloud-pubsub-discuss/893dc4c4-815e-4859-8589-7263eb3b73a4n%40googlegroups.com.


--

--
Jianping Roth
Software Developer
xMatters: Digital Service Availability Platform
jianpi...@xmatters.com250-380-0304 ext 427
----------------
Free Forever | Meet Flow Designer | See it in Action 

Reply all
Reply to author
Forward
0 new messages