Skip to content

Upgrade Spring boot To 4.0.3#227

Open
pmonington wants to merge 48 commits intodevelopfrom
pmonington/upgrade-spring
Open

Upgrade Spring boot To 4.0.3#227
pmonington wants to merge 48 commits intodevelopfrom
pmonington/upgrade-spring

Conversation

@pmonington
Copy link
Copy Markdown

@pmonington pmonington commented Apr 20, 2026

PR Details

Description

This PR upgrades the spring boot version to 4.0.3. This upgrade DOES NOT include the optional upgrade to Jackson 3. This is because Jackson 3 mappers cannot map abstract classes so it causes issues when trying to serialize or deserialize certain classes. In addition, since Jackson 2 is still supported, it didn't fall into scope and caused a bigger lift than expected. This upgrade does include all the other upgrades found here: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-4.0-Release-Notes. Most notable is the Kafka upgrade to 4.

Kafka tests were updated to use @embeddedkafka and @KafkaListener to allow kafka the ability to manage the tests more similarly to how it is done when the system is running and removed the manual wiring.

Related Issue

https://dev.azure.com/SOC-OIT/CDOT/_workitems/edit/471731/

Motivation and Context

The current version is set to have an EOS by 6/26 (https://spring.io/projects/spring-boot#support).

How Has This Been Tested?

mvn test was ran to verify functionality had not changed.

It was also tested locally running docker compose up --build -d. I ran the scripts included in the scripts folder and compared what the develop branch produced to the given streams to what the updates produced to the given streams to ensure the messages were unchanged.

A deployment to dev was made to ensure new configurations worked properly. After it was deployed, I went through messages in the kafka streams before and after deployment to ensure the messages formats remained unchanged after the Spring upgrade and that it was still able to receive messages.

Types of changes

  • [X ] Defect fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that cause existing functionality to change)

Checklist:

  • I have added any new packages to the sonar-scanner.properties file
  • My change requires a change to the documentation.
  • [ X] I have updated the documentation accordingly.
  • [X ] I have read the CONTRIBUTING document.
    ODE Contributing Guide
  • I have added tests to cover my changes.
  • [ X] All new and existing tests passed.

…ad of EmbeddedKafkaZKBroker for transition to kraft instead of zookeeper
…ner, replace EmbeddedKafkaHolder with CountDownLatch for async validation
…ner, replace EmbeddedKafkaHolder with CountDownLatch for async validation
…er, replace EmbeddedKafkaHolder with CountDownLatch for async validation
…ner, replace EmbeddedKafkaHolder with CountDownLatch for async validation
…@KafkaListener, replace EmbeddedKafkaHolder with CountDownLatch for async validation
…@KafkaListener, remove EmbeddedKafkaHolder usage
…ner in all tests, refactor tests to use CountDownLatch for async validation
…ntrollerTest and change order of creation of consumers
…rConfigTest and update topic handling logic
…on of isCertPresent field"

This reverts commit 65a81c0.
@pmonington pmonington changed the title Pmonington/upgrade spring Upgrade Spring boot To 4.0.3 Apr 21, 2026
@@ -1,6 +1,5 @@
package us.dot.its.jpo.ode.udp.generic;

import io.netty.handler.codec.UnsupportedMessageTypeException;
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

After upgrading to springboot 4, this package is no longer included and we only use the import here. This is also the only place that throws and catches this exception since the method that is throwing it is a private method and the method that catches it just logs that there was an unsupported message. Instead of including it back into the project, I adjusted the class to throw and subsequentially catch a custom UnsupportedMessageTypeException. I'm not sure if we wanted to switch this to an IllegalArgumentException instead, but I felt it doesn't really fit the situation a 100 percent.

vmImage: ubuntu-latest

steps:
- checkout: self
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This change is not related to the spring upgrade, but is instead needed to be able to build and deploy the ode.

@pmonington pmonington marked this pull request as ready for review April 23, 2026 22:04
@pmonington pmonington mentioned this pull request Apr 23, 2026
9 tasks
@pmonington pmonington requested a review from Michael7371 April 23, 2026 22:11
…s and JavaBeans naming convention workaround
Copy link
Copy Markdown

@mcook42 mcook42 left a comment

Choose a reason for hiding this comment

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

Looks really great so far! A few chores, but otherwise I'm stoked

Comment thread jpo-ode-svcs/src/test/java/us/dot/its/jpo/ode/udp/psm/PsmReceiverTest.java Outdated
Comment thread jpo-ode-svcs/pom.xml Outdated
Comment thread jpo-ode-svcs/pom.xml Outdated
Comment thread jpo-ode-svcs/pom.xml Outdated
Copy link
Copy Markdown
Collaborator

@iyourshaw iyourshaw left a comment

Choose a reason for hiding this comment

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

Will look at this in more detail, but to start with, a question on first look:

There appear to be some fairly extensive refactorings done to many of the unit tests. Are all those test refactorings necessary because of the Spring and Kafka version upgrades? Or are there additional refactorings there for other purposes that aren't described in the scope of this PR?

Copy link
Copy Markdown
Collaborator

@iyourshaw iyourshaw left a comment

Choose a reason for hiding this comment

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

Overall it looks good!

Just one important documentation issue.

I tested this out and verified that the unit tests all pass.

I did some interoperability testing too, and there is an issue with compatibility with other applications that consume the library JARs produced by this app. This includes jpo-geojsonconverter, jpo-conflictmonitor, and jpo-cvmanager. For example jpo-geojsonconverter has dependencies on the jpo-ode-core and jpo-ode-plugins JARs.

Compatibility was tested as follows:

In a checked-out copy: changed the version number in this PR to a unique value, and changed the dependency version to match in the cdot/develop branch of jpo-geojsonconverter, to force it to pick up the library built from this PR from local maven on the test machine.

Then built this PR branch and deployed the JARs to maven local via:

  ode:    mvn clean install

and built the geojson converter with and without running tests:

  gjc:    mvn clean package -DskipTests

That succeeds: It is possible to compile the GJC using the JAR from this PR

However when running the GCJ tests:

  gjc:    mvn clean test

there are a number of test errors. In fact, all the @SpringBootTest-annotated unit tests in the GeoJSON converter fail when using the library JARs from this PR. This makes sense, but it should be noted in the description for this PR, and in the documentation and compatibility matrix that this update is a breaking change for downstream applications that depend on it, and the major version number should be incremented when it is released.

A library consumer (gjc) unit test error example is attached

us.dot.its.jpo.geojsonconverter.converter.bsm.BsmTopologyTest.txt

@pmonington pmonington requested review from iyourshaw and mcook42 April 27, 2026 16:03
Comment thread docs/compatibility.md Outdated
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.

4 participants