Claus Ibsen created CAMEL-25502:
-----------------------------------

             Summary: camel-core - RouteStoppingException for an exchange cut 
off by a route or CamelContext stop
                 Key: CAMEL-25502
                 URL: https://issues.apache.org/jira/browse/CAMEL-25502
             Project: Camel
          Issue Type: Improvement
          Components: camel-core
            Reporter: Claus Ibsen
             Fix For: 4.23.0


An exchange that is in flight when its route is stopped or reloaded, or when 
the CamelContext stops, is cut off with a plain RejectedExecutionException. 
Nothing in the route failed, but the exception cannot be told apart from a real 
rejection (a full thread pool or queue): CAMEL-25484 recognises it by its 
message text, and the error registry (camel_get_errors, the camel-jbang 
monitor) records it as an error.

Add org.apache.camel.RouteStoppingException (extends 
RejectedExecutionException, so onException and catch blocks for 
RejectedExecutionException still match) and use it where an in-flight exchange 
is cut off by a stop: the error handler (run not allowed), DirectProducer 
interrupted while waiting for a consumer, the delayer and throttlers, threads, 
failover load balancer, resequencer, and the internal processor on a forced 
shutdown. A real rejection (thread pool or queue full, executor saturated) 
stays a RejectedExecutionException.

Then:
* the error handler logs any such cut-off as one WARN line (CAMEL-25484) by its 
type instead of its message
* the error registry does not record it, as nothing failed

Found in the local-model benchmark (route-aggregator), with CAMEL-25484 and 
CAMEL-25500.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to