Hi, You are using the custom resolver API for Java. This API is available only in limited gRPC languages, like Java/Go, but not Core-based languages, like C++/Python/Ruby/C#/ObjC/PHP.
You may need to inject the candidate addresses to DNS backends. Many DNS providers / cloud providers offer this feature. Locally, depending on the OS, there should be ways to define name -> IP resolutions, like /etc/hosts. On Wednesday, February 2, 2022 at 10:40:44 AM UTC-8 Easwar Swaminathan wrote: > You can find gRPC Python documentation here: > https://grpc.github.io/grpc/python/ and a basic tutorial here: > https://grpc.io/docs/languages/python/. > > [+Richard Belleville, +Lidi Zheng] for specific load balancing API in > Python. > > On Fri, Jan 28, 2022 at 4:52 AM animesh sharma <[email protected]> > wrote: > >> Hi Team, >> >> I was trying to implement client side load balancing in gRPC. I know how >> to do it in Java but not able to find appropriate document describing how >> to do the same in python, below is my Java code. >> ``` >> NameResolver.Factory nameResolverFactory = new >> MultiAddressNameResolverFactory( new InetSocketAddress("localhost", 10000), >> new InetSocketAddress("localhost", 10001), new InetSocketAddress( >> "localhost", 10002) ); ManagedChannel channel = >> ManagedChannelBuilder.forTarget("service") >> .nameResolverFactory(nameResolverFactory) .defaultLoadBalancingPolicy( >> "round_robin") .usePlaintext() .build(); >> >> ``` >> >> In python I know how to connect to one server but not a list of gRPC >> servers >> channel = grpc.insecure_channel('localhost:10000') >> >> can anyone kindly guide me or point me to a document on how to implement >> the same? >> >> Thanks, >> >> Animesh >> >> -- >> 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/4ce5e1e3-46cb-482a-829c-6e5c518e6762n%40googlegroups.com >> >> <https://groups.google.com/d/msgid/grpc-io/4ce5e1e3-46cb-482a-829c-6e5c518e6762n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- 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/e8b9e388-0ad7-4089-9396-f79b38fc6d88n%40googlegroups.com.
