Skip to content

[backport camel-4.18.x] CAMEL-26335: camel-cometd - configure allowedTransports and disable callback-polling by default - #28562

Merged
oscerd merged 3 commits into
camel-4.18.xfrom
backport/28555-to-camel-4.18.x
Oct 29, 2026
Merged

oscerd merged 3 commits into
camel-4.18.xfrom
backport/28555-to-camel-4.18.x

Conversation

@gnodet

@gnodet gnodet commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Backport of #28555

Cherry-pick of 44700f0 to camel-4.18.x.
Conflicts resolved automatically by backport bot agent.

@gnodet gnodet added the backport indicate that a Pull request is a backport from a fix from the main branch label Oct 27, 2026
@davsclaus

Copy link
Copy Markdown
Contributor

CI fails to compile the test on camel-4.18.x: CometdAllowedTransportsTest imports org.apache.camel.test.junit6, which does not exist on this branch. It should use org.apache.camel.test.junit5 instead. Also, the "Allowed Transports and JSONP" doc section from #28555 is missing from this backport.

Claude Code on behalf of davsclaus

@oscerd

oscerd commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Adapted the backport for camel-4.18.x:

  • Migrated CometdAllowedTransportsTest to use camel-test-junit5 (org.apache.camel.test.junit5.CamelTestSupport).
  • Removed try-with-resources on HttpClient (not AutoCloseable on Java 17).
  • Added mirrored cometd-component.adoc under catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/ with the "Allowed Transports and JSONP" section.
  • Moved upgrade guide entry to the 4.18.5 to 4.18.6 section in camel-4x-upgrade-guide-4_18.adoc.

Antigravity on behalf of oscerd

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Both concerns from @davsclaus's review are addressed in the second commit (CAMEL-26335: adapt the backport to camel-4.18.x):

  1. junit5 import — CometdAllowedTransportsTest now correctly imports org.apache.camel.test.junit5.CamelTestSupport (not junit6) ✅
  2. Missing doc section — The "Allowed Transports and JSONP" section is present in cometd-component.adoc, and the upgrade guide entry is correctly placed under "Upgrading from 4.18.5 to 4.18.6" in camel-4x-upgrade-guide-4_18.adoc ✅

Implementation review:

  • CometdEndpoint.java: new allowedTransports parameter with sensible default ("websocket,long-polling" — excludes callback-polling/JSONP) and proper @UriParam annotation
  • CometdComponent.java: correctly normalizes whitespace in transport names via Arrays.stream(...).map(String::trim).filter(!empty)
  • Test coverage: 3 integration tests exercising default-rejects-JSONP, default-allows-long-polling, and explicit-JSONP-opt-in scenarios

LGTM — clean backport.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

gnodet and others added 3 commits October 29, 2026 07:20
…Transports and disable callback-polling by default
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
…nent

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
@davsclaus
davsclaus force-pushed the backport/28555-to-camel-4.18.x branch from d849397 to 87df313 Compare October 29, 2026 06:23
@oscerd
oscerd merged commit f0961b6 into camel-4.18.x Oct 29, 2026
3 checks passed
@github-actions
github-actions Bot deleted the backport/28555-to-camel-4.18.x branch October 29, 2026 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport indicate that a Pull request is a backport from a fix from the main branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants