It is safe to share the channel.   The decision of which server is actually 
up to the load balancer, and it will correctly stop sending traffic to a 
server if the connection fails.  

On Thursday, August 9, 2018 at 8:56:08 AM UTC-7, Isuru Samaraweera wrote:
>
> Hi All,
>
> I am trying to use Eureka as a discovery server and do roundrobin 
> clientside load balancing in the grpc client level.I have 3 GRPC server 
> nodes registered in Eureka.
>
> Here is the way I create a ManagedChannel in  the client.
>
> EurekaClientConfig eurekaClientConfig = new DefaultEurekaClientConfig();
> ManagedChannel channel =  ManagedChannelBuilder
>                .forTarget("eureka://" + 
> "service-aeroline-passenger-messaging")                
>                 .nameResolverFactory(new 
> EurekaNameResolverProvider(eurekaClientConfig, "9071"))
>                 
> .loadBalancerFactory(RoundRobinLoadBalancerFactory.getInstance())
>                 .usePlaintext(true)
>                 .build();
>
> My question is is it ok to create one channel and share across the client 
> application presuming that channel rotation across various nodes of GRPC 
> server is taken care by
> the ManagedChannel it self.  i.e if server1 goes down does the channel 
> automatically diverted to server2 without creating a new channel object???
>
> Thanks,
> Isuru
>
>
>

-- 
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/4460b577-ebd2-40d5-aa1f-182a1f4af411%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to