How to set RetryPolicy when calling _publisherClient.PublishAsync via grpc c# client (for PubSub)

Viewed 743

We are publishing messages 1 by 1 to google pubsub service to a given topic using c# with Google.Cloud.PubSub.V1 nuget Every few minutes we receive error message

Grpc.Core.RpcException: Status(StatusCode=Unknown, Detail="Stream removed")

Do I need to set

RetryPolicy

To fix this? (I saw on github issue python1, python 2 & github issue C# that manually doing client retry didn't fix this) So; How to set RetryPolicy when calling _publisherClient.PublishAsync via grpc c# client (for PubSub)

Otherwise should this issue be fixed by enabling

new ChannelOption("grpc.keepalive_permit_without_calls", 1)

What is the meaning of "Stream removed" error?

RpcException - Status Codes (error codes)

2 Answers

The client libraries generally abstract users away from these lower-level concerns.

I agree with you that the C# library should itself be re-establishing streams and retrying publishes as needed. If publishers are not behaving as expected or you think there are properties that should be set on the underlying connections, please put in an issue at https://github.com/googleapis/google-cloud-dotnet/issues

Related