3

I can't find any example in scala/java where the server side is accessing the context of a grpc request (with scalapb / grpc.io). I can find many examples in golang. I found some of with akka grpc but I am using scalapb and grpc.io

If anyone knows of a repo in github that uses it or can layout the steps needs to access it, it would be very kind of you

Nick Ginanto
  • 31,090
  • 47
  • 134
  • 244

1 Answers1

5

In grpc-java and ScalaPB you get access to the request's metadata through client and server interceptors. See: https://grpc.github.io/grpc-java/javadoc/io/grpc/ServerInterceptor.html

Example: https://github.com/saturnism/grpc-java-by-example/tree/master/metadata-context-example/src/main/java/com/example/grpc/server

thesamet
  • 6,382
  • 2
  • 31
  • 42