ApplicationReadyEvent fires multiple time while using SpringApplicationBuilder
See original GitHub issueIssue Analytics
- State:
- Created 6 years ago
- Comments:25 (25 by maintainers)
Top Results From Across the Web
Spring Boot 2 - Do something before the beans are initialized
This will focus on problem of how to run some code before the classes are initialized as beans and put into Spring IoC...
Read more >Core Features - Spring
An ApplicationReadyEvent is sent after any application and command-line runners have been called. An AvailabilityChangeEvent is sent right after with ...
Read more >Spring Boot Application Events Explained - Reflectoring
An ApplicationFailedEvent is fired if there is an exception and the application fails to start. This can happen at any time during startup....
Read more >Spring Boot Reference Guide
In those cases, see the section called “Using Spring Boot ... The SpringApplicationBuilder lets you chain together multiple method calls and includes parent....
Read more >Changes since Spring Boot 1.x - Packt Subscription
These are the most notable changes, but there are so many more, as with any ... Boot application bootstrapping with a tool called...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Regardless I think we should fix it somehow. If we agree the scope of the application is independent of the structure of the application context, then we should fire it only once and at the appropriate time. Not sure however that everybody share the same concept of “application” (perhaps the builder is used to start several apps in isolation in child context?).
Doh - I didn’t notice that code. I guess I am ok with not doing auto wiring - agreed that doco is probably enough at this point.
That said, I am sure I would only use this feature when interested with those “early” events and use a
@Beanfor a “proper” listener.