0
votes

I wonder if there's a way to properly handle the situation when client can establish the channel to the server, but there's no matching service deployed on a server side. So far in my tests I see that client can successfully send an rpc call and then wait forever for response. Is there a way to instruct server or client to throw exception in this case?

I've stumbled upon the fallbackHandlerRegistry. But you can only return empty or null if nothing is found. There's seemingly no way you can say to the server close the call as there's nothing like this is deployed here.

2

2 Answers

0
votes

No, there have logic to handle this situation, what is your language?

In grpc-java, it will check if the method is exist when execute StreamCreated task, and if method not found in registry and fallbackRegistry, it will return UNIMPLEMENTED status right now. You can reference the method StreamCreated#runInternal

0
votes

The server does send UNIMPLEMENTED status in the response to the client and client will receive it as StatusRuntimeException with status = UNIMPLEMENTED