Reputation: 11
I did some practices.
1) Using Ribbon with Eureka enabled. works well. (server-service) 2) Using Ribbon with Eureka disabled, using listOfServer. works well.(server-service-ribbon) 3) For different requests, some going to Eureka get instances of servers then pick one to send the request, some going to Ribbon Server List to ping alive and then pick one to send the request. Questions show up.
Seems like we can only enable/disenable for all instance servers, not individually set them up.
The application.properties shows below, I can use eureka naming server to get instances, but the server-service-ribbon doesn't work because ribbon trying to get instance via eureka and there is no instance named server-service-ribbon.
If i disable eureka, server-service-ribbon works well because it gets instances from ListOfServer, but server-service down since nowhere to retrieve instances(eureka disabled).
yes I did set ribbon.eureka.enabled for each client but seems they don't work.
any help is appreciated :)
server.port=8001
spring.application.name=client-service
eureka.client.service-url.default-zone=http://localhost:8761/eureka
#ribbon.eureka.enabled=false //this is for all services, it works
#for server-service setting, doesn't work.
server-service.ribbon.eureka.eabled=true
#for server-service-ribbon setting, doesn't work.
server-service-ribbon.ribbon.eureka.enabled=false
#these two work.
server-service-ribbon.ribbon.listOfServers=localhost:8101,localhost:8102
server-service-ribbon.ribbon.ServerListRefreshInterval=15000
how can make server-service-ribbon.ribbon.eureka.enabled=false and server-service.ribbon.eureka.eabled=true both works?
it they are supposed working, what is wrong in my code?
Upvotes: 0
Views: 343
Reputation: 11
check it.
https://github.com/spring-cloud/spring-cloud-netflix/issues/1995
TBH I don't know why there are so many examples show
xxx.ribbon.eureka.enabled
but it is invalid.
Upvotes: 1