google-cloud-platformgoogle-cloud-pubsub

How to set retry policy through golang package for google pubsub


Update

Nope, my mistake. Turns out RetryPolicy doesn't work well if you don't actually feed it into the SubscriptionConfig :( .


It doesn't seem possible to affect the retrypolicy of a subscription at all through the go pubsub package.

https://pkg.go.dev/cloud.google.com/go/pubsub#SubscriptionConfig includes a retrypolicy, which has a minimum and maximum backoff, but if you set these, and create a new subscription, the subscription will have a retry policy of immediate.

Is there anyway to set the retry policy of a pubsub subscription using the go pubsub package?


Solution

  • Go Pub/Sub library maintainer here. Could you paste your code here?

    You should be able to create a Subscription with a RetryPolicy without needing to update it after creation.