Sounds like you can just write a ServerInterceptor (which holds the Metrics
object) to intercept ServerCall.Listener.onMessage() and
ServerCall.Listener.onComplete()/onCancel() and do the stuff. I doesn't
seem to involve Context (assuming you meant io.grpc.Context).
On Monday, September 25,
Follow up question:
In the same given scenario above, is it possible to have different Contexts
per message? The use case is that I'd like to have a metrics and logging
utility class on my server that is used to generate graphs and data
distributions using each call as a data point. So I'd
Ahh I see! Thank you very much
On Friday, September 22, 2017 at 11:43:50 AM UTC-7, Josh Humphries wrote:
>
> Headers are per stream, not per message. The whole stream is a single HTTP
> round-trip. So the first thing the server sends back are response headers.
> Then the response payload (which
Headers are per stream, not per message. The whole stream is a single HTTP
round-trip. So the first thing the server sends back are response headers.
Then the response payload (which consists of zero or more messages).
Finally, you get trailers.
To include metadata for each response message,