I'm new in java, in recent days I'm trying to develop a graceful shut down script for my springboot applications, but this confused me a lot...
I have this little question while observing what will happen when I shut down one of my service application.
here is the structure of my testing applications:
Eureka server service (E)
one consumer serivce (A)
two service provider service (B1 and B2)
A calls B by feign client and returns which B is invoked(by using returning string 'service B at [it's port] is invoked').
I have found that no matter when I tried to shut down one of service B in a graceful way by spring boot acurator, there is a strange thing:
I though this shut down instance will still be stay in eureka's instance list and also, in those applications' local cache because A and E may not have chance to reach the fetch or refresh time for new instance list after one of B was down.
So, in this case, I thought there might be a loadbalancer exception thown out because eureka client in A do not fetch a new instance list.
But what I observed was totally different from what I thought.
It seems to have a sneaky method to cancel the shutdown application's instance from eureka and notice all the applications which will call B for a downstream service immediately. All request will be send to B2 after a little time delay if I shut down B1 by sending /actuator/shutdown to B1.
Well, after plenty of jmeter test, it seems that something was doing a quick refresh of alive instance ignoring the eureka server. local cache will refresh automatically when B was shut down( even shut down by kill -9 , nothing wrong will happen if there are at least one B stiill alive.)
I'm new in java, in recent days I'm trying to develop a graceful shut down script for my springboot applications, but this confused me a lot...
I have this little question while observing what will happen when I shut down one of my service application.
here is the structure of my testing applications:
I have found that no matter when I tried to shut down one of service B in a graceful way by spring boot acurator, there is a strange thing: I though this shut down instance will still be stay in eureka's instance list and also, in those applications' local cache because A and E may not have chance to reach the fetch or refresh time for new instance list after one of B was down.
So, in this case, I thought there might be a loadbalancer exception thown out because eureka client in A do not fetch a new instance list.
But what I observed was totally different from what I thought.
It seems to have a sneaky method to cancel the shutdown application's instance from eureka and notice all the applications which will call B for a downstream service immediately. All request will be send to B2 after a little time delay if I shut down B1 by sending /actuator/shutdown to B1.
Parent of the pom is:
Here are my Eureka configuration: eureka server :
client A and B:
Well, after plenty of jmeter test, it seems that something was doing a quick refresh of alive instance ignoring the eureka server. local cache will refresh automatically when B was shut down( even shut down by kill -9 , nothing wrong will happen if there are at least one B stiill alive.)