Skip to content

Add additional Keycloak lifecycle events#42671

Open
thomasdarimont wants to merge 3 commits intokeycloak:mainfrom
thomasdarimont:issue/gh-42670-add-lifecycle-events
Open

Add additional Keycloak lifecycle events#42671
thomasdarimont wants to merge 3 commits intokeycloak:mainfrom
thomasdarimont:issue/gh-42670-add-lifecycle-events

Conversation

@thomasdarimont
Copy link
Copy Markdown
Contributor

This adds a KeycloakInitializedEvent and KeycloakShutdownEvent.

Those events can be used by extensions to register custom logic that should execute after Keycloak server initialization or when the server is about to get stopped.

Fixes #42670

@thomasdarimont thomasdarimont requested a review from a team as a code owner September 16, 2025 23:59
This adds a KeycloakInitializedEvent and KeycloakShutdownEvent.

Those events can be used by extensions to register custom logic that should execute after Keycloak server initialization or when the server is about to get stopped.

Fixes keycloak#42670

Signed-off-by: Thomas Darimont <[email protected]>
@shawkins shawkins force-pushed the issue/gh-42670-add-lifecycle-events branch from 7f90d18 to 1e26001 Compare February 13, 2026 19:34
@ahus1 ahus1 changed the title Add additional Keycloak lifecycle events (#42670) Add additional Keycloak lifecycle events Feb 14, 2026
@mabartos
Copy link
Copy Markdown
Contributor

I like this :) In general, LGTM - even the naming. Quarkus has the StartupEvent and ShutdownEvent, but having the KeycloakInitializedEvent feels more right as there's no confusion like: "Is it executed during the startup or when the KC is fully ready?"

But we need some documentation and tests with some custom implementations.

Copy link
Copy Markdown
Contributor

@vmuzikar vmuzikar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally, I don't see any issues with this. Though I'd like to also get @ahus1 opinion on this as he was recently involved in the area around graceful shutdown.

As mentioned already by @mabartos, a test would be good. Not sure about docs, if we even document events somewhere.

@vmuzikar vmuzikar requested a review from ahus1 February 17, 2026 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add dedicated lifecycle events to signal Keycloak initialized and shutting down

3 participants