Validate request using GRPC server interceptor

隐身守侯 提交于 2021-02-07 08:16:00

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!