I have implemented bidirectional streaming of grpc using java. The problem is whenever the Server side of grpc calls onError. The call reaches the onError on the client-side and onError gets completely executed. But post which I m not able to send any more messages on the same channel from client. Is this the desired behavior? That is whenever the onError is called do we have to recreate the channel on the client-side to initiate further communication.
Asked
Active
Viewed 470 times
1
-
Are you sure you mean "channel"? You should need to re-create the RPC (by calling the stub again), but the channel should not be recreated. If you are having trouble with the channel, describe what issue you see (e.g., an exception, the calls are ignored, etc) – Eric Anderson Jan 12 '22 at 17:25
-
Hey thanks re-creating the stub works. – vignesh suresh Jan 13 '22 at 03:44
-
I'll note stubs are immutable, so the previous RPC can have no impact to it. If recreating it solves a problem, that means you have some inappropriate configuration on it. The most common case for that is a Deadline. A deadline is a fixed point in time like "3:15 PM on Tuesday" so is the same for each RPC. When using stub.withDeadlineAfter() you shouldn't generally save the returned stub, but instead just do an RPC immediately. – Eric Anderson Jan 13 '22 at 17:46
-
Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jan 20 '22 at 18:56