camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Smith <ronsmit...@gmail.com>
Subject threads question
Date Thu, 12 Aug 2010 17:19:38 GMT
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?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message