wu-sheng commented on a change in pull request #4251: Issue about load balance 
of gRPC
URL: https://github.com/apache/skywalking/pull/4251#discussion_r367399006
 
 

 ##########
 File path: 
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/remote/StandardChannelBuilder.java
 ##########
 @@ -30,6 +31,10 @@
 
     @Override public ManagedChannelBuilder build(ManagedChannelBuilder 
managedChannelBuilder) throws Exception {
         return managedChannelBuilder.nameResolverFactory(new 
DnsNameResolverProvider())
+            /**
+             * It seems the code above can only work for low gRPC version.
+             */
+            .loadBalancerFactory(RoundRobinLoadBalancerFactory.getInstance())
 
 Review comment:
   According to the header of RoundRobinLoadBalancerFactory, this is 
experimental. And also, this could use more connections of OAP backend, you 
should create a Config, at `Config#Collector#OPEN_ROUND_ROBIN_LOAD_BALANCE` 
default false, to support this feature. 
   ```
   /**
    * A {@link LoadBalancer} that provides round-robin load balancing mechanism 
over the
    * addresses from the {@link NameResolver}.  The sub-lists received from the 
name resolver
    * are considered to be an {@link EquivalentAddressGroup} and each of these 
sub-lists is
    * what is then balanced across.
    */
   @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1771";)
   public class RoundRobinLoadBalancerFactory extends LoadBalancer.Factory {
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to