Skip to content

CAMEL-22114 - Adapt Atmosphere to JDK 25#21234

Closed
apupier wants to merge 1 commit intoapache:mainfrom
apupier:22114-JDK25-Atmosphere
Closed

CAMEL-22114 - Adapt Atmosphere to JDK 25#21234
apupier wants to merge 1 commit intoapache:mainfrom
apupier:22114-JDK25-Atmosphere

Conversation

@apupier
Copy link
Contributor

@apupier apupier commented Feb 3, 2026

the body is provided in streaming mode with JDK 25 by default. Adapted the test in this sense.

Description

I do not understand why with JDK 25, a streaming mode is used. The streaming mode seems to be something that could potentially be used as there was already the code in test where the streaming is specified. Maybe worth finding the exact explanation to be sure that adapting the test is enough and maybe provide a note in release note or if it is a bug in the component and need to fix it.
Feedback very welcome if someone already worked on this component and remember what is the expected behavior

Another note, a lot of unused code and duplicated code between test classes that would be nice to clean in another iteration.

Target

  • I checked that the commit is targeting the correct branch (Camel 4 uses the main branch)

Tracking

  • If this is a large change, bug fix, or code improvement, I checked there is a JIRA issue filed for the change (usually before you start working on it).

Apache Camel coding standards and style

  • I checked that each commit in the pull request has a meaningful subject line and body.
  • I have run mvn clean install -DskipTests locally from root folder and I have committed all auto-generated changes.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

🌟 Thank you for your contribution to the Apache Camel project! 🌟

🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run

  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot.

  • You can label PRs using build-all, build-dependents, skip-tests and test-dependents to fine-tune the checks executed by this PR.

  • Build and test logs are available in the Summary page. Only Apache Camel committers have access to the summary.

  • ⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

the body is provided in streaming mode with JDK 25 by default. Adapted
the test in this sense.

Signed-off-by: Aurélien Pupier <apupier@ibm.com>
@apupier apupier force-pushed the 22114-JDK25-Atmosphere branch 2 times, most recently from 978165c to 6d2d231 Compare February 3, 2026 14:35
@davsclaus
Copy link
Contributor

(use "git restore ..." to discard changes in working directory)
modified: components/camel-atmosphere-websocket/src/test/java/org/apache/camel/component/atmosphere/websocket/WebsocketRoute1Test.java

@apupier
Copy link
Contributor Author

apupier commented Feb 3, 2026

so seems that it is real bug in atomsphere impacting us and we should not just adjust the test.

The difference is coming from org.atmosphere.cpr.AtmosphereFramework.loadWebSocketFromPath(ClassLoader, String)

With Java 17, (new File("")).exists() is returning false
With Java 25, (new File("")).exists() uis return true

both returns /home/apupier/git/camel/components/camel-atmosphere-websocket when trying to call .getAbsolutePath()

because of this difference, with Java 25, the subdirectories are searched for .class ad potential sublcasses of WebSocketProtocol. it founds 2 of them, and it initialize the AtmosphereFramework with the last one, in our case, always the WebsocketStreamHandler. And then when initializing the websocket with org.atmosphere.cpr.AtmosphereFramework.initWebSocket(), the configuration provided as init parameter is ignored as the webSocketProtocol was already set.

Several points to note:

  • I think that the search on the subclasses on classpath can work only in dev mode as it is looking to regular File and not handle resource inside jars; SO this should not affect runtime. Sounds like a not working functionality of atmosphere.
  • there are parameters in constructors to avoid to search for auto detection of websocket handler BUT, this is not accessible as a parameter (and it is also used for AtmosphereHandler so this migt hinterfere with it

EDIT: sounds this TODO is right: https://github.com/Atmosphere/atmosphere/blob/5d048cd8b95c62333613d5a53aab100cad57b297/modules/cpr/src/main/java/org/atmosphere/cpr/AtmosphereFramework.java#L2491 lol

@apupier
Copy link
Contributor Author

apupier commented Feb 3, 2026

closing as I think this should be better handled on atmosphere side. one proposition Atmosphere/atmosphere#2535

@apupier apupier closed this Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants