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

   # Description
   
   [CAMEL-24924](https://issues.apache.org/jira/browse/CAMEL-24924)
   
   A failover load balancer with no outputs started fine, but every exchange 
sent to it hung. `State.run()` assumed at least one processor and threw (a 
`NullPointerException` in default mode, `ArrayIndexOutOfBoundsException` in 
round robin or sticky mode) on the reactive executor before the callback was 
called.
   
   This change: with no processors, `process()` completes the exchange straight 
away (`callback.done(true)`), as `QueueLoadBalancer` and `TopicLoadBalancer` 
already do.
   
   Tests: new `FailOverLoadBalanceNoProcessorsTest.testNoProcessors` covers 
`failover()`, round robin, sticky, and round robin + sticky, and checks that 
the exchange reaches the next step. Without the fix, all 4 time out. With the 
fix, they pass in 0.3 s. `*LoadBalanc*,Failover*,FailOver*,*Sticky*`: 0 
failures.
   
   If maintainers would rather set an exception on the exchange in this case, 
that's a one-line change.
   
   # 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 modules, 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.
   


-- 
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