0

I have local Consul (consul agent -server -bootstrap -config-file="config/config.json") running. I am running a Spring GrapghQL microservice which when asked will use an endpoint in a second Spring microservice(summerizer). I am running 3 instances of (summerizer), all are captured by Consul as shown in UI on port:8500. My problem is that using the DiscoveryClient to obtain the uri for /summerizer it is always returning the same instance.

The code deliberately gets the top of the list returned : - discoveryClient.getInstances(serviceName).stream().findFirst() .map(si -> si.getUri());

I expected the discovery list order to be changed by Consul to give the Round Robin effect. Am I wrong to expect this ?

Thanks Jan

The research suggested that 'Round Robin' load balancing was Consul default behaviour but I am not seeing that.

The discovery list from consul is always 8083, 8082, 8081 so I always pick 8083.

Jurb
  • 1
  • 1

0 Answers0