When defining very simple routing with ThreadProcessor I get ConcurrentModificationException on multicore systems.
Example:
from("direct:a").thread(10).process(new Processor() {
@Override
public void process(Exchange ex) throws Exception {
//sth
}
});
Stack trace:
Exception in thread "Thread Processor"
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793)
at java.util.HashMap$EntryIterator.next(HashMap.java:834)
at java.util.HashMap$EntryIterator.next(HashMap.java:832)
at java.util.HashMap.putAll(HashMap.java:523)
at
org.apache.camel.processor.Pipeline.createNextExchange(Pipeline.java:146
)
at org.apache.camel.processor.Pipeline$1.done(Pipeline.java:123)
at
org.apache.camel.processor.ThreadProcessor$ProcessCall.run(ThreadProcess
or.j
ava:66)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecuto
r.ja
va:885)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja
va:9
07)
at java.lang.Thread.run(Thread.java:619)
Could you attach your sample that doesn't work on your system.
I have tried to create an unit test that demonstrates the bug but I runs fine here.