I have a google cloud function that is subscribed to a pubsub push-type subscription. Because of the setup, the function does not use http requests to receive or respond to the subscription.
What I am trying to do is trigger a retry for a message for when there is an error in my function (e.g. api limit is hit), so that I can utilize the retry functionality of pubsub to use exponential backoff to keep trying.
I have implement try catch blocks in my function and throwing errors accordingly to try to trigger a retry, but none of the messages are ever retried.
Am I missunderstanding how PubSub works with these retries? Do I need to handle retries in the function's code instead? I am somewhat new to GCP and software development, so I would appreciate any advice.