Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Retriable and non-retriable errors in PubSub

Hi Team,

Is there any way to recreate a retriable exceptions in Pub Sub.

Do we have any dedicated documentation which lists all retriable and non-retriable errors?

 

0 3 877
3 REPLIES 3

Can you elaborate on what you mean by a retriable exception?  PubSub is a delivery vehicle for messages.  PubSub doesn't normally concern itself with the content of the message.  I'm imagining an application that retrieves a message from the topic and then tries to process it.  If the processing fails, then the message is returned to the topic.

Thanks for the replay @kolban ,

I'm referring retriable exceptions from the publisher side. For example, we have a Publisher with retry settings enabled and it's publishing the messages into the topic due to some issue if the cluster is unavailable or we haven't reached acknowledgment back within the defined time, the publisher will try to resend the message as per the configuration we provided.

Publish with retry settings  |  Cloud Pub/Sub Documentation  |  Google Cloud

So, I'm trying to explore what are all the possible retriable exceptions that will happen on the publisher side and if is there any documentation available for the same.

It's a good question ... but sadly I have nothing substantial to add.  I have always heard that when making a Cloud API call, anticipate it failing and be ready to handle it.  Your question then becomes ... when is a failure permanent and when is it sensible to retry?

I looked at the published REST APIs for PubSub and saw no mention of retry at the server side ... so this then made me feel that ALL errors (transient and permanent) are passed back to the caller and the caller decides.  That then maybe me contemplate that the caller is likely using a Google Client Side library ... so I looked at the PubSub client library which is open source and found this.  This seems to show which response status codes are considered retryable ... and .. by inversion ... which are not.