Thanks Josh.
I tried with ClientInterceptor and ServerInterceptor. Its working fine.
I have implemented in java.
Will this interceptor work for http request through postman ?
e.g - for path /v1/health
will these interceptor invoke the request ??
rpc healthCheck(google.protobuf.Empty) returns (HealthCheckResponse) {
option (google.api.http) = {
get: "/v1/health"
};
}
On Sun, Aug 5, 2018 at 5:23 PM, Josh Humphries <[email protected]>
wrote:
> I think several of the languages support the interceptor pattern (I am
> quite familiar with the Java and Go runtime libraries, which do). This
> allows you to register a client interceptor that will get to see every RPC.
> (Intercepting streaming RPCs in Go is a bit more complicated due to having
> a different interface than the interceptor for unary RPCs.)
>
> When you have cross-cutting attributes to associate with every RPC,
> metadata is probably the way to go. So the interceptor could add the
> attributes you mention as request metadata. For Go, you'd probably need to
> have this data stored in a context.Context, which the interceptor will
> query and then store in request metadata. For Java, there is also a context
> type, but it uses thread-local storage (so it can be easier to interact
> with and does not require you to explicitly pass the context to/through
> every function).
>
> ----
> *Josh Humphries*
> [email protected]
>
>
>
> On Sun, Aug 5, 2018 at 4:11 AM shailendra kumar <[email protected]>
> wrote:
>
>>
>> Whenever client call to server, i want to add some attribute like
>> account, accountHolder, accountLocation and their values along with client
>> request. At the server side, i want to collect these info. Please suggest
>> for grpc call as well as rest call
>>
>> --
>> 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/3e68e3d6-74d2-4082-90b0-5361bd4238d0%40googlegroups.com
>> <https://groups.google.com/d/msgid/grpc-io/3e68e3d6-74d2-4082-90b0-5361bd4238d0%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
--
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/CABCQYsQFteoo%2BqGgZGeTLTD8e2Zfq_zTfUFPcH4iv5Jk6qsJ_g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.