问题
I need to validate and log some of the data of grpc service request using an interceptor. I checked interceptCall of ServerInterceptor and could not find a way to get the request object. Is there any way to get the request object inside an interceptor ?
回答1:
You need to return and extend a ForwardingServerCallListener
and listen to the ServerCall.Listener.onMessage()
callback.
来源:https://stackoverflow.com/questions/39389771/validate-request-using-grpc-server-interceptor