davsclaus opened a new pull request, #30690:
URL: https://github.com/apache/camel/pull/30690

   _Claude Code on behalf of davsclaus_
   
   [CAMEL-27484](https://issues.apache.org/jira/browse/CAMEL-27484)
   
   ### Problem
   
   Many WebSocket feeds only start sending after the client sends a subscribe 
request, e.g. `{"op":"subscribe","channel":"..."}`. A `consumeAsClient` 
consumer could not send anything, so the websocket-source Kamelet 
(apache/camel-kamelets#3379) only worked with servers that push without being 
asked.
   
   ### Change
   
   - New option `connectMessage` (consumer): a text message that the client 
consumer sends each time it connects, when it starts and after each reconnect.
   - It is sent from `connect()`, after the consumer's handlers are set on the 
WebSocket, so the server's answer is not missed. It is not sent by a reconnect 
attempt that closes its WebSocket because the consumer was stopped.
   - If the write fails, a WARN is logged. The message is sent again on the 
next reconnect.
   - Docs with a YAML example.
   
   ### Tests
   
   - `VertxWebsocketConsumerAsClientConnectMessageTest`: a plain Vert.x server 
that only answers a client that sent `subscribe`. The route receives 
`subscribed 1`. After the server closes the connection, the consumer reconnects 
and subscribes again, and the route receives `subscribed 2`.
   - All 124 tests of camel-vertx-websocket pass.
   
   This touches the same docs section, options and generated files as #30687 
(CAMEL-27481), so the second of the two to merge needs main merged in.
   
   🤖 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]

Reply via email to