Skip to content

[camel-4.22.x] CAMEL-25917: camel-undertow - a WebSocket connection accepted while only a producer served the path is not treated as having passed a later consumer's custom handlers - #28505

Merged
davsclaus merged 1 commit into
apache:camel-4.22.xfrom
Croway:fix/CAMEL-25917-camel-4.22.x
Oct 26, 2026

Conversation

@Croway

@Croway Croway commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Jira: https://issues.apache.org/jira/browse/CAMEL-25917

Backport of #28237 to camel-4.22.x (cherry-pick of 56aa5f4).

On a WebSocket path whose producer applies a security provider or allowed roles, a connection accepted while only the producer served the path, before its consumer was first started, did not run the custom handlers that the consumer configures. Once the consumer started, that connection was still served. The handshake result now records whether it ran in consumer mode, so such a connection is no longer served once a consumer with handlers is up, and the consumer closes it as soon as it starts. The window tests send on that connection on a best effort basis, since it may already be closed.

Tests: components/camel-undertow mvn verify on this branch: BUILD SUCCESS, 225 tests, 0 failures, 1 skipped (including SecurityProviderWebSocketConsumerHandlersWindowTest, UndertowWsOAuthProfileConsumerWindowTest and UndertowWsSecurityWithoutProviderTest)

…nly a producer served the path is not treated as having passed a later consumer's custom handlers (apache#28237)

* CAMEL-25917: camel-undertow - a WebSocket connection accepted while only a producer served the path is not treated as having passed a later consumer's custom handlers

* CAMEL-25917: close WebSocket peers that no longer pass the path checks when the consumer starts

Close the already-open connections of a path right away when a consumer is
set, rather than only when they next send a message, so a receive-only client
is told to reconnect instead of silently receiving nothing after the consumer
with custom handlers starts. Add a regression test that awaits the close
without the client sending, and adjust the existing window tests for the now
proactive close.

* CAMEL-25917: camel-undertow - make the window tests tolerate the proactive close

The consumer now closes a connection opened before it started as soon as it
starts, so sending on that connection afterwards is best effort and bounded.

(cherry picked from commit 56aa5f4)
@github-actions

Copy link
Copy Markdown
Contributor

🌟 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 although they are normally detected and executed by CI.
  • You can label PRs using 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.

@github-actions

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • components/camel-undertow

ℹ️ Dependent modules were not tested because the total number of affected modules exceeded the threshold (50). Use the test-dependents label to force testing all dependents.


🔬 Scalpel shadow comparison — Scalpel: 38 tested, 29 compile-only — current: 38 all tested

Maveniverse Scalpel detected 67 affected modules (current approach: 38).

⚠️ Modules only in Scalpel (29)
  • apache-camel
  • camel-allcomponents
  • camel-catalog
  • camel-catalog-console
  • camel-catalog-lucene
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-csimple-maven-plugin
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • docs
  • dummy-component

Skip-tests mode would test 38 modules (1 direct + 37 downstream), skip tests for 29 (generated code, meta-modules)

Modules Scalpel would test (38)
  • camel-a2a
  • camel-consul
  • camel-cxf-rest
  • camel-cxf-soap
  • camel-cxf-spring-rest
  • camel-cxf-spring-soap
  • camel-cxf-spring-transport
  • camel-cxf-transport
  • camel-jbang-mcp
  • camel-jbang-plugin-mcp
  • camel-jbang-plugin-route-parser
  • camel-jbang-plugin-tui
  • camel-jbang-plugin-validate
  • camel-jsonpath
  • camel-knative-http
  • camel-launcher-container
  • camel-lra
  • camel-mcp-server
  • camel-micrometer-observability
  • camel-micrometer-prometheus
  • camel-oauth
  • camel-observability-services
  • camel-openapi-validator
  • camel-opentelemetry
  • camel-opentelemetry2
  • camel-platform-http-main
  • camel-platform-http-vertx
  • camel-rest-openapi
  • camel-slack
  • camel-soap
  • camel-telemetry
  • camel-telemetry-dev
  • camel-undertow
  • camel-undertow-spring-security
  • camel-vertx-http
  • camel-yaml-dsl-validator
  • camel-yaml-dsl-validator-maven-plugin
  • camel-zookeeper
Modules with tests skipped (29)
  • apache-camel
  • camel-allcomponents
  • camel-catalog
  • camel-catalog-console
  • camel-catalog-lucene
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-csimple-maven-plugin
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • docs
  • dummy-component

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more


⚙️ View full build and test results

@davsclaus davsclaus added this to the 4.22.3 milestone Oct 26, 2026
@davsclaus davsclaus added the enhancement New feature or request label Oct 26, 2026
@davsclaus
davsclaus merged commit 890bf42 into apache:camel-4.22.x Oct 26, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

components enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants