Claus Ibsen created CAMEL-25047:
-----------------------------------
Summary: camel-core - Reifiers and error handler: fix bugs found
in a deep review
Key: CAMEL-25047
URL: https://issues.apache.org/jira/browse/CAMEL-25047
Project: Camel
Issue Type: Bug
Components: camel-core
Reporter: Claus Ibsen
A deep review of the reifiers in camel-core-reifier (route, error handler,
onException and the EIP reifiers) found the bugs below. Each one was reproduced
against 4.23.0-SNAPSHOT and has a test that fails without the fix.
# *onException useOriginalBody fails unless allowUseOriginalMessage is turned
on.* The reifier turns on allowUseOriginalMessage for useOriginalMessage but
not for useOriginalBody, so the exchange failed with "AllowUseOriginalMessage
is disabled".
# *The redelivery options of an onException reset the error handler's options
to the defaults.* When an onException sets any redelivery option (such as
maximumRedeliveries), every option it does not set was filled in with the model
default (redeliveryDelay 1000, logStackTrace true, ...) instead of being
inherited from the error handler. So
errorHandler(defaultErrorHandler().redeliveryDelay(0)) with
onException(...).maximumRedeliveries(3) waited 1 second per redelivery. The
defaults were added in Camel 3.17 when the error handler became part of the
model; the error handler itself never used them.
# *logName of defaultErrorHandler and deadLetterChannel is ignored.* No reifier
read it, so the XML/YAML logName attribute did nothing.
# *A disabled multicast or pipeline with a single output still runs.* With one
output the processor is that output's channel, where the disabled flag is not
checked at runtime.
# *An error handler with an unknown executorServiceRef fails with
NullPointerException* instead of "ExecutorService x not found in registry". The
deadLetterChannel also did not resolve a placeholder in the ref.
# *Property placeholders are not resolved in the executorService of delay and
throttle*, while split, multicast and others resolve them.
# *Property placeholders are not resolved in aggregationStrategyMethodName of
split, enrich, pollEnrich, aggregate and claimCheck*, while multicast and
recipient list resolve them. The retryWhileRef of the deadLetterChannel was not
resolved either.
*Not changed (for a later look)*
* interceptSendToEndpoint: the intercepted route id and from uri come from the
first route that registered the intercept, and the callbacks of the other
routes are never removed.
* The load balancer and its children do not get ids and route ids, so
context.getProcessor(id) does not find them.
* doTry without doCatch or doFinally is accepted (the null check on the catch
list is dead).
* threads keepAliveTime is parsed as a duration (milliseconds) but used with
timeUnit (seconds by default).
_Claude Code on behalf of Claus Ibsen_
--
This message was sent by Atlassian Jira
(v8.20.10#820010)