You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have thankfully used the latest container to run our tests on. However, there was one feature that I was not able to use which was the support for dead letter topic.
Support for dead-letter-topics
Basically when following the example from google, one should be able to configure the subscriptions in a way that messages will be forwarded to a dead letter topic whenever a certain maximum number of attempts is reached.
fromgoogle.cloudimportpubsub_v1subscriber=pubsub_v1.SubscriberClient()
subscription_path=subscriber.subscription_path(project_id, subscription_id)
defcallback(message):
print(f"Received {message}.")
print(f"With delivery attempts: {message.delivery_attempt}.") # Delivery attempt should be an integer when a dead letter topic is setmessage.ack()
streaming_pull_future=subscriber.subscribe(subscription_path, callback=callback)
print(f"Listening for messages on {subscription_path}..\n")
withsubscriber:
streaming_pull_future.result(timeout=timeout)
Delivery attempt is None, but never an integer
You should be able to receive a message with the delivery_attempt property set to an integer number (works only in case the dead-letter-topic is set). With the current container, the delivery_attempt property was always None, regardless of the settings I used.
Re-building the container fixed this issue
I decided to re-build the container with an up-to-date google SDK for testing, and indeed that solved the problem. I am not exactly sure which part(s) are not working for the dead-letter-topic feature in the current container, but it would be great if an updated (and tagged) container could be uploaded to docker hub. In the meantime I'll be using my own build for testing.
Thanks in advance
The text was updated successfully, but these errors were encountered:
I have thankfully used the latest container to run our tests on. However, there was one feature that I was not able to use which was the support for dead letter topic.
Support for dead-letter-topics
Basically when following the example from google, one should be able to configure the subscriptions in a way that messages will be forwarded to a dead letter topic whenever a certain maximum number of attempts is reached.
Delivery attempt is None, but never an integer
You should be able to receive a message with the
delivery_attempt
property set to an integer number (works only in case the dead-letter-topic is set). With the current container, thedelivery_attempt
property was always None, regardless of the settings I used.Re-building the container fixed this issue
I decided to re-build the container with an up-to-date google SDK for testing, and indeed that solved the problem. I am not exactly sure which part(s) are not working for the dead-letter-topic feature in the current container, but it would be great if an updated (and tagged) container could be uploaded to docker hub. In the meantime I'll be using my own build for testing.
Thanks in advance
The text was updated successfully, but these errors were encountered: