I have an Eureka server running on a local machine. Eureka clients are registered to this server. I am able to view the eureka dashboard to see the instances registered.
Can I have an event listener on the server side that will be triggered when instances are registered or cancelled?
I went through the source code and figured out that eureka dispatches the following 3 events from springs ApplicationContext
EurekaInstanceRenewedEvent
EurekaInstanceRegisteredEvent
EurekaInstanceCancelledEvent
Of these only the EurekaInstanceRenewedEvent
works and the listener is triggered when the server receives a heartbeat. I am not able to listen to the other events when a new instance is registered or canceled from eureka.
Any help will be appreciated.