davsclaus opened a new pull request, #30687: URL: https://github.com/apache/camel/pull/30687
_Claude Code on behalf of davsclaus_ [CAMEL-27481](https://issues.apache.org/jira/browse/CAMEL-27481) ### Problem `VertxWebsocketClientConsumer` runs the route for each received message with `vertx.executeBlocking(..., false)`. With `ordered = false`, Vert.x runs these tasks in parallel on the worker pool, so the messages of one WebSocket reach the route in any order. A server that pushed 20 messages in order had them arrive shuffled, which breaks ordered feeds such as prices, events and sequence numbers. Found while writing the websocket-source Kamelet (apache/camel-kamelets#3379). ### Change - The client consumer uses `executeBlocking(..., true)`. Vert.x runs the blocking tasks of the WebSocket's context one after the other, so the messages reach the route in the order received. The route still runs off the event loop, which is why `executeBlocking` is there (`VertxWebSocketSlowClientConsumerTest` still passes). - With the asynchronous routing of CAMEL-27294 (the default, `synchronous=false`), the task ends as soon as the route continues on another thread. So the order is the order the messages enter the route. - New option `parallelProcessing` (consumer, advanced, default `false`): `true` routes in parallel, as before. - Docs, plus an upgrade-guide entry because the default changes. The server consumer (`VertxWebsocketConsumer`) also uses an unordered `executeBlocking` per message. It is left as it is: with `ordered = true`, all connections that share an event loop would queue behind each other. ### Tests - `VertxWebsocketConsumerAsClientOrderTest`: a plain Vert.x server pushes 50 numbered messages, and the route waits a random 0-10 ms per message. They arrive in order by default, and all of them arrive with `parallelProcessing=true`. With the old `false`, the ordered test fails (the first message received was 9). - All 124 tests of camel-vertx-websocket pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
