CAMEL-23112: Lower minimum JDK requirement from 21 to 17#21991
Open
CAMEL-23112: Lower minimum JDK requirement from 21 to 17#21991
Conversation
- Change jdk.version from 21 to 17 in root pom.xml - Create JDK 17 fallback for CamelThreadFactory using new Thread() - Move JDK 21 CamelThreadFactory (virtual threads) to MRJAR java21/ directory - Replace List.getLast() (JDK 21) with index-based access in JsonObject - Replace String.splitWithDelimiters() (JDK 21) with Pattern/Matcher in JsonObject - Add @EnabledForJreRange(min=JAVA_21) to ManagedVirtualThreadExecutorTest Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
SSLParameters.getNamedGroups/setNamedGroups (JDK 20) and getSignatureSchemes/setSignatureSchemes (JDK 19) are called via reflection so the code compiles and runs on JDK 17. On JDK 17, these SSL configuration options are silently skipped. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace Executors.newThreadPerTaskExecutor() (JDK 21) with reflection in DefaultThreadPoolFactory VIRTUAL enum - Replace Thread.threadId() (JDK 19) with Thread.getId() in ExpressionBuilder.threadIdExpression() Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The applyPqcNamedGroupDefaults method added in main uses SSLParameters.getNamedGroups() (JDK 20+) directly. Use the reflection-based getNamedGroupsFromParams() helper instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use reflection-based helpers for SSLParameters.getNamedGroups() and getSignatureSchemes() (JDK 20/19 APIs) and add @EnabledForJreRange annotations to skip these tests on JDK < 21 at runtime. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use reflection to call Executors.newVirtualThreadPerTaskExecutor() which is a JDK 21 API not available with --release 17 compilation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace List.addFirst() (JDK 21 SequencedCollection) with List.add(0, ...) in SpringAiImageOllamaIT. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
oscerd
approved these changes
Mar 13, 2026
davsclaus
approved these changes
Mar 13, 2026
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.
Summary
Changes
pom.xml:jdk.version21 → 17CamelThreadFactory: JDK 17 base version usesnew Thread(). JDK 21 version (withThread.ofVirtual()/Thread.ofPlatform()) moved tosrc/main/java21/MRJAR directory incamel-utilJsonObject: ReplacedList.getLast()(JDK 21 SequencedCollection) withlist.get(list.size() - 1), andString.splitWithDelimiters()(JDK 21) with aPattern/MatcherequivalentManagedVirtualThreadExecutorTest: Added@EnabledForJreRange(min = JAVA_21)since it usesExecutors.newVirtualThreadPerTaskExecutor()Trade-offs
Test plan
camel-utilJAR containsMETA-INF/versions/21/org/apache/camel/util/concurrent/CamelThreadFactory.classJIRA: https://issues.apache.org/jira/browse/CAMEL-23112