In java there are two ways: The first and more common way is to install a ServerInterceptor, which has access to the Metadata (a.k.a. headers). Typically the interceptor will create a ForwardingServerCall, which will add the desired headers in the close() method. Since the location of the code that wants to add the header is usually far away from where the interceptor is installed, the interceptor can read the headers out of the Context. When handling an RPC, add the custom headers into the context and the interceptor will apply them.
The second way is more complicated, and that is to use the ServerCall object directly. This is useful if you want more advanced control over the call. Few people use this. On Monday, September 11, 2017 at 8:39:26 PM UTC-7, [email protected] wrote: > > Wanted to know how to send trailing metadata (headers) in case of success > scenarios. I'm aware of how to send it in cases of exceptions but couldn't > find a way to do it in case of success. Although there seems to be a way to > do in python. > > > https://stackoverflow.com/questions/46126094/how-to-access-trailing-metadata-from-python-grpc-client > -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/grpc-io. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/84d656b0-1d2e-471a-9a6d-c45aea4901a9%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
