davsclaus opened a new pull request, #28989: URL: https://github.com/apache/camel/pull/28989
Fixes [CAMEL-26507](https://issues.apache.org/jira/browse/CAMEL-26507). Follow-up of CAMEL-26158 (#28941). ## What was wrong The `vertx` producer failed an exchange without a body with an `InvalidPayloadRuntimeException` ("Cannot send a message without a body to the event bus address: ..."). The Vert.x event bus supports a null body: in Vert.x 5.2.1 (the version in `parent/pom.xml`), `CodecManager.lookupCodec` picks the built-in `NullMessageCodec` for a null body, and `EventBusImpl` send/publish/request only null-check the address, not the body. A message without a body is a normal trigger or ping signal. ## What changed - `VertxProducer` sends the null body for send, publish (`pubSub=true`) and request (InOut), instead of failing. The reply handling is unchanged and works with a null request body and a null reply. - The consumer side needed no change: it sets the received null body on the exchange, and it already replies with a null body (covered by `VertxRequestReplyFailureTest#testNullBodyIsReplied`). ## Tests New `VertxNullBodyTest` (6 tests, all failed before the change): - send, publish to two consumers, and request/reply with a null body arrive at `vertx` consumers with a null body - a request with a null body gets a null reply without an error - a plain event bus handler receives a null body from send, and replies to a null-body request `VertxRequestReplyFailureTest#testSendWithoutBodyFails` (added by #28941) asserted the old failure and is removed. Module build with `-Psourcecheck`: 42 tests, all pass. ## Docs and generated files - The `@BodyTypes` of the endpoint: `producerIn` now includes `null` and no longer says "no body fails"; `consumerOut` says a message sent without a body has a null body. - The component doc says a message without a body is sent with a null body. - Regenerated `vertx.json` and the catalog copies of the JSON and the doc. - No upgrade guide entry: it turns a failure into a successful send. _Claude Code on behalf of Claus Ibsen (davsclaus)_ 🤖 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]
