Spring Cloud Eureka Client

503 views Asked by At

I'm using Spring Cloud in a docker container so I have a Eureka server in one container and a Eureka client in another container. My problem is that the order in which the containers start up, if the client starts up before the eureka server then I get lots of exceptions in the log e.g.

config-service_1    | 2016-12-22 19:12:16.621  WARN 1 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_CONFIG-SERVICE/e0453b771ca0:config-service:8888 - registration failed Cannot execute request on any known server
config-service_1    |
config-service_1    | com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server

After the eureka server starts up then the client successfully registers, however is there a way to configure the client not to fail in this way and fill the logs with exceptions, can it fail silently?

1

There are 1 answers

0
LHCHIN On

That is normal. Because once your client startup, it will try to connect to eureka server specified in your configuration and register itself. So it will keep retrying until the eureka server is up and can be connected successfully.

Therefore, I don't think that this kind of message is an exception but warning. Even though you start eureka server and your clients sequentially , you cannot ensure that which one will be ready to be accessed first if there is much logic in eureka server.