consol client example

154 views
Skip to first unread message

Gadi Eichhorn

unread,
Jul 22, 2020, 7:55:52 AM7/22/20
to Go kit
Hi all,

I am looking for a good example of calling a remote server (from another server) as a client.
* using consul discovery
* load- balance
* circuit-breaker
* rate limiting

the example I found seemed to be over complicated making Endpoints and then wrapping them in a factory:

var remote participant.RemoteEndpoints
{
   instancer := consul.NewInstancer(client, logger, consulService, consulTags, passingOnly)
   factory := factoryFor(participant.MakeRemoteEndpoint)
   endpointer := sd.NewEndpointer(instancer, factory, logger)
   balancer := lb.NewRoundRobin(endpointer)
   retry := lb.Retry(retryMax, retryTimeout, balancer)
   remote.Test = retry
}

is there an example that is not using endpoints?
why using endpoints is so complex?

Thanks.
Reply all
Reply to author
Forward
0 new messages