最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

spring boot - How to recover data from Google pubsub topic subscription when my service is down - Stack Overflow

programmeradmin0浏览0评论

I have subscribed to a Google pub/sub topic from my spring boot application with subscription.What happens if my service is down and There is some data which is pushed to pub/sub topic. Will i receive data to my application from the subscription when my service is up?

I have subscribed to a Google pub/sub topic from my spring boot application with subscription.What happens if my service is down and There is some data which is pushed to pub/sub topic. Will i receive data to my application from the subscription when my service is up?

Share Improve this question asked Jan 29 at 14:17 qwertyqwerty 252 silver badges9 bronze badges 3
  • Typically, yes. I am not familiar with how spring boot pulls messages from a queue, but the way it normally works is your application takes a message, processes it, then confirms to the subscription it no longer needs that message. Messages won't remain on a topic indefinitely ... check with the owner of the topic how long your grace period is, but the whole system is designed to allow for intermittent failures in the applications retrieving the messages. – jsf80238 Commented Jan 29 at 14:44
  • 1 Messages are not lost - see googlecloudcommunity/gc/Cloud-Product-Articles/…. – John Williams Commented Jan 29 at 15:43
  • 1 If I recall correct, GCP will store unacked messages for 7 days by default. In a previous assignment, we experienced that all listeners stopped listening because of a short disruption in GCP PubSub, but nothing was lost, and all messages were processed after restarting pods. BR – Roar S. Commented Jan 29 at 20:56
Add a comment  | 

1 Answer 1

Reset to default 2

One of the main reasons to use Pub/Sub as a messaging bus between services is because it will store messages when the subscriber is unavailable and then deliver them once the subscriber comes back online. As long as the subscriber comes back up before the expiration period passes, then messages published within the message retention duration that were not already acknowledged by the subscriber will be delivered.

发布评论

评论列表(0)

  1. 暂无评论