Hello! I am working with PubSub and BigQuery and was trying to test out deadletter settings to ensure messages are published to deadletter queue since I need proof of it working. At the moment, I have the following configuration, all done manually for the moment through gcp console.
In BigQuery, I have a dataset with a table called “learningTable”.
In PubSub I have a topic called “mainTopic”, and a topic called “deadletterTopic”. Both of these have the default pull subscriptions. In mainTopic, I have created another subscription called “BigQueryTest-sub” with the configations as follows:
- Delivery Type: Write to BigQuery, Use Topic Schema
- Message retention duration: 10 mins
- Ack deadline: 10 seconds
- Retry policy: Retry immediately
- Dead lettering: deadLetterTopic, and max delivery attempts of 5.
After creating this subscription, I went to the dead lettering tab and granted role permissions for publisher and subscriber roles. Everything shows up blue. When I manually publish messages to my mainTopic, I can see them populating in BigQuery, and I see them in my default subscriber. Now to test if the deadletter is working, I deleted my learningTable, and published some messages. I saw the messages in my default subscription, and in my BigQueryTest-sub I saw the unacked messages and oldest unacked message age graphs go up. So there were messages not sent. However, once I go to the dead lettering tab, I see nothing. And when I check the deadLetterTopic, there is nothing published to it either.
I believe I have this setup correctly because I went through and made a push subscription as well, with an endpoint that wouldn’t work. When I did this (and went through the same relevant steps as above), the messages would show up in the dead letter queue.
To complicate things more, I sent some 16 messages through the gcp console for the mainTopic while the table in BigQuery was deleted. Of those 16, one of them made it through to the dead letter queue, but the other 15 or so were shown as being unacked until my retention window was down.
Maybe I’m bad at googling, but I was not finding anything on this topic. Are we unable to test BigQuery subscriptions and dead letter queues in the way I am testing it?
I appreciate any help you may give, thank you.