aerogear / keycloak-metrics-spi

Adds a Metrics Endpoint to Keycloak
Apache License 2.0
523 stars 151 forks source link

Keycloak 25 compatibility #204

Open jannickherrmann opened 2 weeks ago

jannickherrmann commented 2 weeks ago

Motivation

I want to use the metrics spi with the newest keycloak version.

Releated issue: https://github.com/aerogear/keycloak-metrics-spi/issues/199

What

Migrating to compatible RESTEasy Reactive dependencies.

Why

The current implementation is incompatible with Keycloak 25 due to the complete transition to RESTEasy Reactive. See issue: https://github.com/keycloak/keycloak/issues/29223.

How

Both the Maven pom.xml and the build.gradle files have been updated to reflect the new dependencies. Additionally, support for WildFly JBoss has been removed because the code could not be easily migrated to the reactive dependencies. Moreover, I do not see a necessity for maintaining WildFly support: https://www.keycloak.org/migration/migrating-to-quarkus.

Verification Steps

  1. run mvn compile or ./gradlew build to verify

Checklist:

Progress

Additional Notes

nicolabeghin commented 2 weeks ago

+1 thanks @jannickherrmann !

jabbrwcky commented 2 weeks ago

👍 Note: When building locally I also had to update gradle to 8.5, because Keycloak 25.x switches to OpenJDK 21 LTS which is not supported by gradle 7.2

Keycloak will eventually drop support for JDK <21 https://www.keycloak.org/docs/latest/release_notes/#java-17-support-is-deprecated

jannickherrmann commented 2 weeks ago

Yes, I read that too, but since it is currently "only" deprecated and has not yet been removed, I haven't touched it yet. It's my first pull request in this repository, so I didn't want to make too big a change straight away. @jabbrwcky Maybe I'll update the PR later and include the change, thanks for your feedback.

alexanderwolz commented 1 week ago

👍

I can also confirm that this snapshot works with my Keycloak 25.0 setup. Thanks a lot @jannickherrmann

nicolabeghin commented 6 days ago

If useful, here's the JAR built from @jannickherrmann's repository branch keycloak-25-compatibility:

keycloak-metrics-spi-5.0.1-SNAPSHOT.jar.zip

(had to stupidly ZIP-it otherwise attachment not allowed in Github comment)

git clone git@github.com:jannickherrmann/keycloak-metrics-spi.git
git checkout feature/keycloak-25-compatibility
docker run --rm -v $(pwd):/opt/keycloak-metrics-spi -w /opt/keycloak-metrics-spi maven:3-eclipse-temurin-21-alpine bash -c "mvn clean package"
zip keycloak-metrics-spi-5.0.1-SNAPSHOT.jar.zip target/keycloak-metrics-spi-5.0.1-SNAPSHOT.jar
estin68 commented 6 days ago

If useful, here's the JAR built from @jannickherrmann's repository branch keycloak-25-compatibility:

keycloak-metrics-spi-5.0.1-SNAPSHOT.jar.zip

(had to stupidly ZIP-it otherwise attachment not allowed in Github comment)

git clone git@github.com:jannickherrmann/keycloak-metrics-spi.git
git checkout feature/keycloak-25-compatibility
docker run --rm -v $(pwd):/opt/keycloak-metrics-spi -w /opt/keycloak-metrics-spi maven:3-eclipse-temurin-21-alpine bash -c "mvn clean package"
zip keycloak-metrics-spi-5.0.1-SNAPSHOT.jar.zip target/keycloak-metrics-spi-5.0.1-SNAPSHOT.jar

Thanks @nicolabeghin for the downloadable link and docker command.