Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gRPC load balancer/name resolver example? [closed]

Tags:

go

grpc

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

like image 411
Maxim Podkolzin Avatar asked Dec 09 '17 01:12

Maxim Podkolzin


1 Answers

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.

like image 67
user6328154 Avatar answered Oct 07 '22 08:10

user6328154