According to the documentation, there are two events that will be fired when a service auto-registers. The first event, called InstancePreRegisteredEvent, is fired before the service is registered. The second event, called InstanceRegisteredEvent, is fired after the service is registered. You can register an ApplicationListener(s) to listen to and react to these events.

But org.springframework.cloud.netflix.eureka.serviceregistry.EurekaAutoServiceRegistration#start will only publish one InstanceRegisteredEvent, InstancePreRegisteredEvent will never come out.

I see org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration#start will publish those two type of event, but EurekaAutoServiceRegistration is not a subclass of it.

https://cloud.spring.io/spring-cloud-commons/multi/multi__spring_cloud_commons_common_abstractions.html#_serviceregistry_auto_registration_events

Spring Cloud Version: "2021.0.9"

Comment From: OlgaMaciaszek

Hello @XhstormR, thanks for reporting the issue. Will fix it.