sam
sam

Reputation: 1290

Google pub/sub stops sending messages

I am using the latest version google-cloud-pubsub and am experiencing a bug that has been claimed to be fixed.

I am using this version and the code example in there: https://pypi.org/project/google-cloud-pubsub/

<snip>
subscription = subscriber.subscribe(subscription_name)
def callback(message):
   print(message.data)
   message.ack()
subscription.open(callback)
<snip>

Problem: So, after about 4-5hrs of me running the subscriber worker that calls the subscriber, it stops receiving messages.

Any suggestions on how to fix it?

Upvotes: 1

Views: 688

Answers (1)

Max Dietz
Max Dietz

Reputation: 178

Are you sure there were messages being published in your backlog? Also are you waiting afterwards for the subscriber to complete? Replacing subscription.open(callback) with subscription.open(callback).result will cause you to wait on the future so that the program does not return. Providing more of your code may make this easier to debug.

Upvotes: 1

Related Questions