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

   # Description
   
   [CAMEL-25249](https://issues.apache.org/jira/browse/CAMEL-25249)
   
   `VertxConsumer` replies to an event bus message that expects a reply with 
the message body when the exchange is done. It ignored the exception of the 
exchange, and skipped the reply when the body was `null`:
   
   - a failed route answered with a successful reply, usually the request 
itself: a Camel sender (`to("vertx:...")` with InOut) saw no exception, a 
Vert.x `eventBus.request(...)` got a succeeded result;
   - a route ending without a body sent no reply, so the sender waited until 
its reply timeout (30 s by default) and failed with `ReplyException(TIMEOUT)`.
   
   This change: when the exchange failed the consumer replies with 
`Message.fail(500, "Exchange processing failed")` (the sender gets a 
`ReplyException` with `RECIPIENT_FAILURE`). The exception of the route is not 
sent to the sender, following the security model's rule for consumers that 
reply (as `muteException` does by default in camel-grpc, camel-mina, 
camel-coap); it stays with the route's error handler. 500 is a choice: Vert.x 
leaves the failure code to the application. Otherwise it always replies with 
the body, also when it is `null`. Exceptions handled by 
`onException(...).handled(true)` are not failures, so their response is replied 
as before. The upgrade guide for 4.23 gets a note because senders now see these 
failures and empty replies.
   
   Tests:
   - `VertxRequestReplyFailureTest` (new): a route that throws (failure type, 
code and the fixed message are checked), and a route that sets a `null` body.
   - Without the change both fail (`expected: 
<io.vertx.core.eventbus.ReplyException> but was: <null>`, and a 30 s `TIMEOUT` 
reply exception).
   - With the change all camel-vertx tests pass: 31 tests, 0 failures.
   
   # Target
   
   - [x] I checked that the commit is targeting the correct branch (Camel 4 
uses the `main` branch)
   
   # Tracking
   - [x] If this is a large change, bug fix, or code improvement, I checked 
there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for 
the change (usually before you start working on it).
   
   # Apache Camel coding standards and style
   
   - [x] I checked that each commit in the pull request has a meaningful 
subject line and body.
   - [ ] I have run `mvn clean install -DskipTests` locally from root folder 
and I have committed all auto-generated changes.
     (I built and tested the affected module, including the formatter and 
import-sort plugins. I did not run the full root build.)
   
   # AI-assisted contributions
   
   - [x] If this PR includes AI-generated code, commits have proper 
co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR 
description identifies the AI tool used.
     This PR was prepared with Claude Code (Claude Opus 5.5). The commit 
carries a `Co-Authored-By` trailer.
   
   _Claude Code on behalf of allthingssecurity_
   
   🤖 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