Hello,
I am trying to understand the policy Google Pub/Sub uses to deliver messages to a listener.
- is each message delivered as soon as it becomes available or is there any kind of batching? how to control the settings?
- does the answer change if we are using a pub/sub listener directly vs. a push subscription to a Spring (Java) service?
- let's say there is a topic and it has 1000 messages. When I add a new subscription, will I get the messages that were there in the topic before my subscription was created?
- there could be millions of messages accumulated before I added my subscription. Is there some setting to control the window of past messages? Past messages = messages before subscription was added
- will the past messages be delivered all at once in a burst or is there some policy controlling the rate of delivery?
- again, do the answers change if using a listener directly vs. push subscription to Spring Java service.
Sorry if this is documented somewhere but I could not find it.
Thanks!
Solved! Go to Solution.
Hello Morpheus,
A lot of this is documented in little help snippets when you try to create a topic or subscription. The rest is from Google's documentation here:
https://cloud.google.com/pubsub/docs/subscriber
Regards.
Hello Morpheus,
A lot of this is documented in little help snippets when you try to create a topic or subscription. The rest is from Google's documentation here:
https://cloud.google.com/pubsub/docs/subscriber
Regards.
Regarding your questions about messages that pre-date the subscription creation, quoting from the doc at https://cloud.google.com/pubsub/docs/subscriber#what-subscription:
"Only messages published to the topic after the subscription is created are available to subscriber clients. However, you can also enable topic retention to allow a subscription attached to the topic to seek back in time and replay previously published messages."
Thanks a lot to both of you. Happy to receive more replies and insights into this complex topic.