Hi,

I'm trying to find examples for how I can achieve a conditional forwarding 
interceptor, on the server. My gRPC instances can have stateful information 
attached to them (stored in Zookeeper), mainly the ID of a Job currently 
running on a node. I can get a node's host/port based on the Job ID from a 
little service discovery utility ("getAddressByJobId(jobId)" etc.), and so 
I'd like requests for getting a Job's status to be routed to the correct 
node based on the requested Job ID. If there is no node hosting the Job, 
then I don't want any forwarding at all, and instead just call the current 
node's "getJobStatus" method. In the case where the interceptor does 
forward, I can set a "forwarded" header so that when the correct node does 
get the request, the interceptor won't continue to forward/redirect.

I can get simple interceptor examples to work fine - but am struggling to 
get this specific flow to work. Anyone have something like this available? 
If not, could someone be kind enough to show an example of how I might do 
this?

Thanks,
- Matt

-- 
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/7d2be666-2373-4f06-a70e-a55bae33a1ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to