Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Before eureka is registered, InstancePreRegisteredEvent will not be published. #4237

Closed
XhstormR opened this issue Jan 8, 2024 · 1 comment
Assignees
Labels
Milestone

Comments

@XhstormR
Copy link

XhstormR commented Jan 8, 2024

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"

@OlgaMaciaszek
Copy link
Collaborator

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

@OlgaMaciaszek OlgaMaciaszek moved this to In Progress in 2023.0.1 Jan 23, 2024
@OlgaMaciaszek OlgaMaciaszek added this to the 4.1.1 milestone Jan 23, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in 2023.0.1 Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

No branches or pull requests

2 participants