Do ApplicationStartedEvent and ContextStartedEvent Differ in Spring Boot?

This article explains the differences between ApplicationStartedEvent and ContextStartedEvent in Spring Boot, clarifies their inheritance hierarchy, and lists the key events provided by Spring Boot, highlighting that ContextStartedEvent is not used in the framework.

Programmer DD
Programmer DD
Programmer DD
Do ApplicationStartedEvent and ContextStartedEvent Differ in Spring Boot?

In Spring Boot, the event mechanism redefines several events separate from core Spring. Both ApplicationStartedEvent and ContextStartedEvent inherit from SpringApplicationEvent, which itself extends ApplicationEvent, making them peer events.

Spring Boot does not use ContextStartedEvent; instead it provides the following events:

ApplicationStartingEvent
ApplicationEnvironmentPreparedEvent
ApplicationPreparedEvent
ApplicationStartedEvent <= newly added
ApplicationReadyEvent
ApplicationFailedEvent
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Eventsspring-bootApplicationStartedEventcontextstartevent
Programmer DD
Written by

Programmer DD

A tinkering programmer and author of "Spring Cloud Microservices in Action"

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.