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* jh...@bluegosling.com On Sun, Aug 5, 2018 at 4:11 AM shailendra kumar <shailendra...@gmail.com> 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 grpc-io+unsubscr...@googlegroups.com. > To post to this group, send email to grpc-io@googlegroups.com. > 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 grpc-io+unsubscr...@googlegroups.com. To post to this group, send email to grpc-io@googlegroups.com. 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/CAO78j%2B%2BrfODyK5-Bfn5p0HZToibFKBLPvx-Nt6a5un5%3DYsO19A%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.