I have created a route like this:

from("tibco:queue:myqueue")
    .threads(10)
    .bean(StepOne.class, "handleMessage")
    .bean(StepTwo.class, "handleMessage")


I had been testing my app without the threads(). After adding the threads()
I was surprised to find that it still only creates one instance of StepOne
and StepTwo and has all ten threads use those single instances. There is
probably something in the docs somewhere that says that is how it works but
I must have missed it. I was surprised because I prefer to use separate
instance of classes for each thread so I don't have to mess around with
ThreadLocal, etc. and, of course, everyone thinks the same way as me :-)

Is there an easy way to get camel to create separate instances for each
thread?

Reply via email to