[GAZ-328] Migrate message-gateway to Java 21 / Spring Boot 3.4 / Camel 4 / Jakarta - #84
Open
GiulioRinalduzzi wants to merge 1 commit into
Open
Conversation
GiulioRinalduzzi
force-pushed
the
migrate/sb34-jakarta-jdk21
branch
from
August 7, 2026 08:10
0b09e29 to
881a662
Compare
Same recipe as the paymenthub-ee-* connectors: versions come from
enforcedPlatform('org.mifos:paymenthub-ee-bom:2.0.0-SNAPSHOT'), no
hand-pinned versions except the SMS vendor SDKs and okhttp, which the BOM
does not manage.
Jakarta:
- javax.persistence / javax.xml.bind / javax.annotation -> jakarta.*
(8 files). javax.sql.DataSource stays javax: it is JDK, not Jakarta EE.
Runtime fixes found by actually booting the app against MySQL, not by
compiling it:
- AbstractPersistableCustom used GenerationType.AUTO. Hibernate 5 turned
that into AUTO_INCREMENT on MySQL, which is what every table in
db/migration declares; Hibernate 6 turns it into a sequence table
(m_tenants_seq, ...) that does not exist, so every insert failed.
Now GenerationType.IDENTITY.
- SmsOutboundMessageRepository.findByIdInAndTenantId took a String while
OutboundMessages.tenantId is a Long. Hibernate 5 allowed it, Hibernate 6
refuses to build the query and the whole context fails to start. The
method has no callers, so the type was never exercised.
Build:
- Spring Boot 2.5.6 -> 3.4.4, source/target 11 -> 21, Gradle 7.3 -> 8.10.2
- Flyway 6.4.0 -> 10.x (forced by Spring Boot 3.4); Flyway 10 moved MySQL
support into flyway-mysql, added as a separate dependency
- mysql:mysql-connector-java -> com.mysql:mysql-connector-j (BOM managed)
- gson and okhttp are now declared. Both are imported directly by the code
(gson in 8 files, okhttp in JasminSMSProvider and CallbackEventListner)
but were only reaching the classpath as transitives of the InfoBip SDK,
so bumping or dropping an SMS vendor would have broken unrelated
classes. gson takes its version from the BOM (2.8.9 -> 2.11.0, the old
strictly/force pin is gone); okhttp keeps the 2.3.0 it already resolved
to, since moving to okhttp3 is a source change.
- velocity dropped: nothing imports it, but it was quietly supplying
commons-lang 2.x (last released 2011) to three helper classes. Declared
commons-lang3 directly and switched those three imports.
- retrofit dropped as a declared dependency; it is still on the classpath
via the InfoBip SDK, but no source references it
- spring-kafka dropped: no source reference and no configuration
- removed the repository URL with a stray quote in it
(jfrog.sandbox.fynarfin.io), which no longer exists either
- profile-standalone / profile-deployable used jar.baseName and
war.baseName, removed in Gradle 8 -> archiveBaseName / archiveVersion
- useJUnitPlatform() and bootJar -> app.jar, as in the other repos
Docker and CI:
- Dockerfile: openjdk:11 -> eclipse-temurin:21-jre, and copy app.jar
instead of the *.jar glob, which also matched the -plain.jar. Now also
exposes 5009, the Camel REST port; callbackconfig.port is outbound only
and stays unexposed.
- CircleCI: openjdk:17-buster-node-browsers-legacy -> the shared PHEE
template on cimg/openjdk:21.0.6, multi-arch, image name from CIRCLE_*
application.yml: dropped spring.jpa.hibernate.use-new-id-generator-mappings,
removed in Spring Boot 3.
GiulioRinalduzzi
force-pushed
the
migrate/sb34-jakarta-jdk21
branch
from
August 7, 2026 08:49
881a662 to
53ff22f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Java 21 / Spring Boot 3.4.4 / Camel 4.4.1 / Jakarta EE 10, same recipe as the
paymenthub-ee-*connectors: versions come fromenforcedPlatform('org.mifos:paymenthub-ee-bom:2.0.0-SNAPSHOT'). Targetsdevas requested. cc @tdaly61Jakarta: only 8 of 79 source files needed it —
javax.persistence(25),javax.xml.bind(2),javax.annotation(2).javax.sql.DataSourcedeliberately staysjavax: it is JDK, not Jakarta EE. There is no Spring Security anywhere in this repo, which is normally the hard part of a Spring Boot 3 move.Hibernate 6: two changes were needed to make the application start.
AbstractPersistableCustomusedGenerationType.AUTO→ nowIDENTITY. Every table indb/migrationdeclares its idAUTO_INCREMENT, which is what Hibernate 5 produced fromAUTOon MySQL; Hibernate 6 turns it into a sequence table instead.SmsOutboundMessageRepository.findByIdInAndTenantIdtook aStringwhileOutboundMessages.tenantIdis aLong. Hibernate 6 refuses to build the derived query. The method has no callers — happy to delete it instead if you prefer.Dependencies
flyway-mysqlis now a separate dependency. This is the bit that overlaps with @kanishk Singh's postgres work — the swap should beflyway-mysql→flyway-database-postgresqlplus the driver, andIDENTITYworks on postgres too, so that part needs no further change.mysql:mysql-connector-java→com.mysql:mysql-connector-j(BOM managed).JasminSMSProviderandCallbackEventListner— but neither was declared: they only reached the classpath as transitives ofcom.infobip:infobip-api-java-client. Bumping or dropping an SMS vendor would have broken eight unrelated classes. gson now takes its version from the BOM, which moves it 2.8.9 → 2.11.0 (the oldstrictly/forcepin is gone). okhttp keeps the 2.3.0 it already resolved to, so nothing changes at runtime — but note that iscom.squareup.okhttp2.x from 2015, and moving to okhttp3 is a source change worth its own ticket, especially as Jasmin is the provider you want for the integration test.velocitydropped — nothing imports it, but it was quietly supplyingcommons-lang2.x (last released 2011) to three helper classes. Declaredcommons-lang3directly and switched those three imports.retrofitdropped as a declared dependency. To be precise: retrofit 1.9.0 is still on the classpath, pulled in by the InfoBip SDK. Nothing insrc/references it, so only the declaration went away.spring-kafkadropped — zero source references and zero configuration..../fyn-libs-snapshot'); that JFrog no longer exists either.Build, Docker, CI
profile-standalone.gradleandprofile-deployable.gradleusedjar.baseName/war.baseName, removed in Gradle 8 →archiveBaseName/archiveVersion.openjdk:11→eclipse-temurin:21-jre, copiesapp.jarinstead of the*.jarglob (which also matched the-plain.jarthat has noMain-Class), and now exposes 5009 as well — the Camel REST port, which the delivery-report callbacks need.callbackconfig.portis outbound only, so it stays unexposed.openjdk:17-buster-node-browsers-legacy→ the shared PHEE template (cimg/openjdk:21.0.6, multi-arch, image name fromCIRCLE_PROJECT_*).application.yml: droppedspring.jpa.hibernate.use-new-id-generator-mappings, removed in Spring Boot 3.Not touched, worth flagging
src/testdirectory. Until there is one, CI proves only that it compiles. The Dummy-provider smoke test is the obvious first one to automate.RouteBuilderin the repo and the startup log saysRoutes startup (started:0); onlyCamelContextandExchangeare used, fromZeebeWorkers. So most of the fivecamel-*dependencies are dead weight. Left alone here, but worth a ticket.application.ymlhas a hard-coded Telerivet API key and project id committed in the clear, andspring.datasource.urlisjdbc:mysql:thin://, which is not a valid MySQL JDBC URL. Both pre-existing, but the key probably wants rotating.sendEmailis abstract onProviderwith an empty body in all 7 providers.