0
votes

I have Eureka service discovery and Netflix Zuul to route multiple instances of my microservice running on multiple machines. How can I add more routes in this property so that Netflix Zuul can load balance different IP addresses.

zuul.routes.microservice.url=http://${ip address}/8100/

I tried these properties from previous questions but didn't work

microservice.ribbon.listOfServers=http://{machine 1 address}:8100/,http://{machine 2 address}:8100/,http://localhost:8100/
microservice.ribbon.NIWSServerListClassName=com.netflix.loadbalancer.ConfigurationBasedServerList
1
Sorry did not know about this policy, thank you for informing meamin224

1 Answers

0
votes

Turns out i left an important note that proved i was not load balancing by using the above properties.

https://cloud.spring.io/spring-cloud-netflix/reference/html/#router-and-filter-zuul

Below properties worked for me

zuul.routes.microservice.path=/microservice/**
zuul.routes.microservice.serviceID=microservice1
microservice1.ribbon.listOfServers=http://{machine 1 ip address}:8100/,http://{machine 2 ip address}:8100/,http://localhost:8100/
microservice1.ribbon.eureka.enabled=true