Repository navigation
[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 intoOct 26, 2026
Conversation
…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)
Contributor
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
Contributor
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 38 tested, 29 compile-only — current: 38 all testedMaveniverse Scalpel detected 67 affected modules (current approach: 38).
|
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.
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
handlersthat 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 withhandlersis 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.camel-4x-upgrade-guide-4_24.adoc, which does not exist on this branch, so it is left out. The upgrade guide entry for 4.22.3 is added onmainin a separate doc-sync PR.CamelWebSocketHandlerand the tests applied cleanly.HandshakeResultalready carries theconsumerflag added here), so it should be merged after this one.Tests:
components/camel-undertowmvn verifyon this branch: BUILD SUCCESS, 225 tests, 0 failures, 1 skipped (includingSecurityProviderWebSocketConsumerHandlersWindowTest,UndertowWsOAuthProfileConsumerWindowTestandUndertowWsSecurityWithoutProviderTest)