I want to implement fan-out(one-to-many) by Pub/Sub. In specific, I want to publish the event to 5000 pods.
For this, I will make a dynamic subscription whenever each pod starts.
Each pod will subscribe to one dedicated subscription.
However, as the quota of the number of subscriptions is 10000,
the unnecessary subscription should be deleted immediately.
Does pub/sub have any callback or methods that a subscription is no longer active subscriber?
I tried a dead letter topic and connected the subscription to the dead letter. I found that the undelivered messages were not delivered to the dead letter. The 'nacked' messages are sent to the dead letter topic.
In my scenario, the messages would never be delivered if a single subscribing pod dies.
I want to catch the event that a message cannot be delivered as there is no active subscribers.
Hi @sesangcho,
Welcome to Google Cloud Community!
Currently, there is no direct callback for inactive subscribers in Pub/Sub. However, you may consider checking the num_undelivered_messages and oldest_unacked_message_age in Cloud Monitoring and set up alerting policies to track activities related to your subscriptions. This might be particularly helpful in your case scenario.
Alternatively, you can submit a feature request regarding this for enhanced functionality. While I can’t provide a timeline for when this will be implemented, I recommend keeping an eye on the tracker and checking the release notes and documents for the latest updates.
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.