[keycloak-dev] Extension for Health-Checks in Keycloak

Thomas Darimont thomas.darimont at googlemail.com
Tue Apr 4 16:45:40 EDT 2017

Hello group,

I wrote a small Keycloak extension [0] that exposes a health endpoint
with health-checks as a RealmResource.
Health Checks can be contributed with a dedicated SPI.
(I took some inspiration from Spring Boot and Wildfly Swarm Health-Checks:

I'm now looking for general feedback and suggestions for additional health
that could be added (infinispan?) - perhaps this could even be added to
Keycloak directly.

Some things I noticed:
1) RealmResourceProvider allows to expose custom JAX-RS resources on realm
level but
there is no equivalent for "global" Resources, e.g. something like
KeycloakResourceProvider / PublicResourceProvider is missing.
I wanted to add health-check for the whole Keycloak Server not just a

2) It seems that many requests lead to a database tx being commited via
org.keycloak.services.filters.KeycloakTransactionCommitter, even if there
is no write to the database.
Is this intended?

3) The keycloak-server BOMs didn't work for me. Even if I declare

in my pom.xml I need to provide <version> settings to keycloak
dependencies, e.g.
which shouldn't be the case with a correct maven BOM.

I tried this with keycloak version 2.5.5.Final and 3.0.0.Final


[0] https://github.com/thomasdarimont/keycloak-health-checks

More information about the keycloak-dev mailing list