cool. Pretty much what I was planning to do, but just wanted to confirm
there are no other options. thanks for your help.


On Mon, Jul 20, 2020 at 3:15 PM Eric Anderson <[email protected]> wrote:

> Interceptors are not great for routing to different backends. That'd be
> the job of a LoadBalancer. For your case, it sounds like you could also
> just create a Channel implementation instead of a ClientInterceptor. It
> could create multiple ManagedChannels and decide which to use based on the
> application logic.
>
> On Mon, Jul 20, 2020 at 10:21 AM Sivabalan <[email protected]> wrote:
>
>> Hi folks,
>>     Let's say I have an interceptor which dictates which host to route
>> the application request to based on some business logic. In okhttp client,
>> it is straightforward by re-creating the request with a new host url. From
>> my understanding of grpc, a channel/managedchannel is tightly coupled with
>> the host and so(I do understand we could leverage dns resolver etc, but if
>> not for that), an interceptor can't really update the host once the channel
>> is created. If the request has to be routed to a different host compared to
>> what current channel was instantiated, a new channel has to be
>> instantiated, followed by adding all interceptors again and then start
>> serving requests.
>>
>> Is my understanding correct? If there is any workaround to update the
>> host dynamically by one of the interceptors.
>>
>> --
>> Regards,
>> -Sivabalan
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/grpc-io/CABeKz3md8b-UQvMLcTqVyXt%3DAQP1ooTPVte93%3D4bOFffgEcShg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/grpc-io/CABeKz3md8b-UQvMLcTqVyXt%3DAQP1ooTPVte93%3D4bOFffgEcShg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
Regards,
-Sivabalan

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CABeKz3%3Di8yKwad2_JuMC7nLM3ORejqS8A77gXf07oNzEWwAwjQ%40mail.gmail.com.

Reply via email to