0
votes

I try google pubsub dead lettering.

I use console cloud to enable the dead lettering for 1 subscription. I already set the dead letter topic and maxAttemptDelivery attribute to 5.

My expectation is if 1 message redelivery more than 5 times in 1 subscription, that message will be automatically removed from the subscription queue. But it does not happen, the message still infinite loop in the queue. And when i print the attribute deliveryAttempt, the value always null.

Do I have configure something in the code? Currently I only configure the deadletter in gcp console. I am using golang, google pubsub version 1.3.1

1

1 Answers

0
votes

If the deliveryAttempt field is null, that usually means you have not set the dead letter policy correctly. Please check on the UI if the dead letter policy is set as expected.

Also, be sure to follow the permission section of the setup guide.

You do not have to configure anything in your subscriber code.