Skip to content

Allow application listeners to register additional listeners in early events #32300

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

Closed
philwebb opened this issue Sep 13, 2022 · 0 comments
Closed
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@philwebb
Copy link
Member

philwebb commented Sep 13, 2022

Currently EventPublishingRunListener collects listeners attached to SpringApplication on construction and uses them for all early events. This means that it's not possible for an ApplicationStartingEvent listener to add additional listeners to the SpringApplication. We're going to need to support this for AOT testing.

@philwebb philwebb self-assigned this Sep 13, 2022
@philwebb philwebb added the type: enhancement A general enhancement label Sep 13, 2022
@philwebb philwebb added this to the 3.0.0-M5 milestone Sep 13, 2022
philwebb added a commit to philwebb/spring-boot that referenced this issue Sep 13, 2022
Update `EventPublishingRunListener` so that event listeners may add
additional listeners to the `SpringApplication` during early events.

Prior to this commit, the listeners were collected only once which
meant that if a listener for an `ApplicationStartingEvent` called
`application.addListener(...)`, it would be ignored.

Closes spring-projectsgh-32300
philwebb added a commit to philwebb/spring-boot that referenced this issue Sep 13, 2022
Update `EventPublishingRunListener` so that event listeners may add
additional listeners to the `SpringApplication` during early events.

Prior to this commit, the listeners were collected only once which
meant that if a listener for an `ApplicationStartingEvent` called
`application.addListener(...)`, it would be ignored.

Closes spring-projectsgh-32300
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant