Does anybody have working gRPC load balancer/name resolver example in go? Nothing fancy just round robin over list of predefined addresses.
UPDATE: What i mean is that gRPC has dial option WithBalancer, which is used like
var opts []grpc.DialOption
b := grpc.RoundRobin(r) //r - name resolver
opts = append(opts, grpc.WithBalancer(b))
conn, err := grpc.Dial("", opts...)
Is there any example of how to implement name resolver to work with this code?
Thanks
https://github.com/wothing/wonaming
Wonaming is a simple grpc-go balancer & naming implementation, supporting etcd and Consul as the service register/discovery backend. Wonaming also supports self-register to etcd/consul.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With