Jens Kleine-Herzbruch created CAMEL-16566:
---------------------------------------------
Summary: Nested enrich with shareUnitOfWork=true result in
ConcurrentModificationException
Key: CAMEL-16566
URL: https://issues.apache.org/jira/browse/CAMEL-16566
Project: Camel
Issue Type: Bug
Components: came-core
Affects Versions: 3.7.3
Reporter: Jens Kleine-Herzbruch
If you have routes that have nested enrichers that use shareUnitOfWork=true,
you'll get a ConcurrentModificationException when the subroutes are joined back.
{code:java}
from("direct:routeA").
enrichWith("direct:routeB", true, true).body((a, b) -> a);
from("direct:routeB").
enrichWith("direct:routeC", true, true).body((a, b) -> a);
from("direct:routeC").setBody(constant("xxx")); {code}
{code:java}
org.apache.camel.CamelExchangeException: Error occurred during aggregation.
Exchange[0A01B3DD98090F3-0000000000000001]. Caused by:
[java.util.ConcurrentModificationException - null]
at org.apache.camel.processor.Enricher$1.done(Enricher.java:247)
~[camel-core-processor-3.7.3.jar:3.7.3]
at org.apache.camel.AsyncCallback.run(AsyncCallback.java:44)
~[camel-api-3.7.3.jar:3.7.3]
...
Caused by: java.util.ConcurrentModificationException
at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1042) ~[?:?]
at java.util.ArrayList$Itr.remove(ArrayList.java:1010) ~[?:?]
at
org.apache.camel.impl.engine.DefaultUnitOfWork.handoverSynchronization(DefaultUnitOfWork.java:202)
~[camel-base-engine-3.7.3.jar:3.7.3]
at
org.apache.camel.impl.engine.DefaultUnitOfWork.handoverSynchronization(DefaultUnitOfWork.java:179)
~[camel-base-engine-3.7.3.jar:3.7.3]
at
org.apache.camel.support.DefaultExchange.handoverCompletions(DefaultExchange.java:612)
~[camel-support-3.7.3.jar:3.7.3]
at org.apache.camel.processor.Enricher$1.done(Enricher.java:242)
~[camel-core-processor-3.7.3.jar:3.7.3]
... {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)