April 2018
Intermediate to advanced
432 pages
10h 38m
English
Checking how a deregistration works with a Eureka Client is a bit more of a difficult task. Our application should be shut down gracefully in order to be able to intercept a stopped event and send an event to the server. The best way for a graceful shutdown is by using the Spring Actuator /shutdown endpoint. The actuator is a part of Spring Boot and it can be included in the project by declaring the spring-boot-starter-actuator dependency in pom.xml. It is disabled by default, so we have to enable it in the configuration properties. For the sake of simplicity, it is worth disabling user/password security for that endpoint:
endpoints: shutdown: enabled: true sensitive: false
To shut down the application, we have ...