Reputation: 1290
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
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