Description
Add a dedicated provider events to signal that Keycloak is initialized or getting shutdown.
Discussion
No response
Motivation
It is quite common to run some custom logic once Keycloak has fully started. Currently, it's common to use the PostMigrationEvent to solve this. However, this event only implicitly signals that the server is "ready".
In case a user wants to execute logic on the server shutdown there is no reliable way to do this.
For symmetry reasons it would be helpful to have an event to signal a completed server initialization and a server shutdown.
Details
We could define two additional ProviderEvent's like KeycloakInitializedEvent and KeycloakShutdownEvent.
This would allow users to register a ProviderEventListener via the KeycloakSessionFactory/ ProviderEventManager to register custom logic that runs when Keycloak is initialized or is about to get shutdown.
Description
Add a dedicated provider events to signal that Keycloak is initialized or getting shutdown.
Discussion
No response
Motivation
It is quite common to run some custom logic once Keycloak has fully started. Currently, it's common to use the
PostMigrationEventto solve this. However, this event only implicitly signals that the server is "ready".In case a user wants to execute logic on the server shutdown there is no reliable way to do this.
For symmetry reasons it would be helpful to have an event to signal a completed server initialization and a server shutdown.
Details
We could define two additional
ProviderEvent's likeKeycloakInitializedEventandKeycloakShutdownEvent.This would allow users to register a
ProviderEventListenervia theKeycloakSessionFactory/ProviderEventManagerto register custom logic that runs when Keycloak is initialized or is about to get shutdown.