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

   # Description
   
   [CAMEL-25277](https://issues.apache.org/jira/browse/CAMEL-25277)
   
   An InOut NATS consumer answers a request (a message with a reply subject) 
with the body of the exchange. It did so also when the exchange failed, so the 
requester got a successful reply, usually its own request echoed back, and 
never learned that the request failed. Same family as CAMEL-25250 (grpc) and 
CAMEL-25249 (vertx).
   
   NATS has no error reply, so this change sends no reply when the exchange 
failed or is marked rollback only, as camel-jms and camel-sjms (without 
`transferException`) and camel-spring-rabbitmq do: the requester times out 
(`ExchangeTimedOutException` after `requestTimeout` with the camel-nats 
producer). The exception is not sent to the requester. A failure that the route 
handles (`onException(...).handled(true)`) is answered as before. The upgrade 
guide for 4.23 gets a note.
   
   Tests:
   - `NatsConsumerReplyToFailureIT` (new, 2 tests): a request to a route that 
throws must time out, and a request to a route that handles the exception gets 
the handled body.
   - Without the change the first fails: the request returns `World`, its own 
body (`Expected org.apache.camel.CamelExecutionException to be thrown, but 
nothing was thrown`).
   - With the change the module's unit tests (5) and the 26 ITs that use 
`NatsITSupport` (core and JetStream) pass against a local nats-server 2.15.0; 
the 4 auth ITs need their own containers and were skipped. (Locally without 
Docker: the test-infra skips even `-Dnats.instance.type=remote` because 
`NatsService` is a `ContainerTestService`, so the run used a temporary, 
uncommitted change to `NatsITSupport`.)
   
   # 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