Is there a way to specify the retention period for the messages in google cloud pub/sub? Let's say I have a subscriber started consuming messages, but the service crashed and is back online a day later after the bug is fixed. Can it continue from the last checkpoint? How soon the consumer needs to reconnect with the pub/sub to guarantee that it won't lose any messages?
On a similar note, the Amazon Kinesis can keep messages up to 24 hours, and Kafka can have retention policy based on time or/and disk space.
No - Redis' Pub/Sub has no persistence, and once a message has been published, it is sent only to the connected subscribed clients. Afterwards, the message is gone forever.
You can set a maximum retention period of 3,155,760,000 seconds (100 years).
There is no limit on the number of retained messages. If subscribers don't use a subscription, the subscription expires.
To pause receiving messages for a subscription, send a modifyPushConfigRequest to set the push endpoint to an empty string. The messages will accumulate, but will not be delivered. To resume receiving messages, send another modifyPushConfigRequest request with a populated push endpoint.
Google Cloud PubSub Subscriptions can now be created with a custom message retention duration using the beta API and gcloud CLI, e.g.:
# gcloud beta pubsub subscriptions create mysub --topic=mytopic --message-retention-duration=48h
Accepted values are between 10 minutes to 7 days (the default).
For reference: https://cloud.google.com/sdk/gcloud/reference/beta/pubsub/subscriptions/create
Subscriptions can now also be updated (beta): https://cloud.google.com/sdk/gcloud/reference/beta/pubsub/subscriptions/update
Subscriptions can retain undelivered messages for up to 7 days. It's not configurable.
FYI various limits including this one are described here: https://cloud.google.com/pubsub/quotas
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With