Video in progress

How do you organize a project to move 80 Java services from JDK 17 to JDK 21?

First I prepare the shared layers (base image, build plugins, shared libraries), then measure on a few pilot services, and roll out in waves through the golden path. Success is measured by runtime and memory metrics staying the same or improving.

📖 Answer

A JDK upgrade is usually easy on the code side: there are few breaking changes from 17 to 21. The hard part is 80 services, 12 teams and unknown dependencies.

  1. Inventory: which JDK, which Spring Boot version and which image each service uses. This simple question often goes unanswered, so the first result is that table.

  2. The platform layer:

  • base images with 21;
  • release=21 in the build templates, and Maven/Gradle plugins updated (old Lombok, Mockito, ByteBuddy and Jacoco versions do not recognize the new bytecode, and this is where most errors come from);
  • shared internal libraries compatible with both 17 and 21 (built with release=17, tested on 21).
  1. Pilot: 3-4 services of different character: heavily loaded, memory-hungry, with old libraries. You measure startup time, p99, GC pauses and RSS. The default GC and heap ergonomics can differ a bit between versions.

  2. Waves: for services on the golden path, a PR that bumps the template version (Renovate), which the team merges if CI is green. It goes out with a canary, with no other changes in the same release.

  3. The long tail: the last 10-15% of services, with old frameworks and no owner. They need a separate plan or direct help.

I do not turn on virtual threads at the same time as the migration. That is a separate change: pinning inside synchronized (until JDK 24), libraries that rely on ThreadLocal, connection pool limits. They need to be measured separately.

A dashboard: the distribution of JDK versions across services and weekly progress. That way everyone can see where the project stands.