Re: threads question

2010-08-13 Thread Claus Ibsen
The route is created once before Camel is started and hence the bean is created once. And there is no way currently to say the scope is "per thread". Camel provides a pool you can use if you want to go down that path: ServicePool On Fri, Aug 13, 2010 at 4:13 PM, Ron Smith wrote: > The whole r

Re: threads question

2010-08-13 Thread Ron Smith
The whole reason for having an instance per thread is so that there won't be shared state between the instances but there can be resources that are reused for each Exchange that passes through the bean. There are/could be many resources that I want to have an instance per thread. For example, one o

Re: threads question

2010-08-12 Thread Claus Ibsen
On Fri, Aug 13, 2010 at 2:26 AM, Ron Smith wrote: > I don't really want a new bean every time it is called. I just want one for > each thread. Why do you want to share state on the bean? You can easily code a method which is thread safe by not using any shared objects. And what's there really to

Re: threads question

2010-08-12 Thread Ron Smith
I don't really want a new bean every time it is called. I just want one for each thread. On Thu, Aug 12, 2010 at 1:22 PM, Claus Ibsen wrote: > On Thu, Aug 12, 2010 at 7:19 PM, Ron Smith wrote: > > I have created a route like this: > > > > from("tibco:queue:myqueue") > >.threads(10) > >.

Re: threads question

2010-08-12 Thread Claus Ibsen
On Thu, Aug 12, 2010 at 7:19 PM, Ron Smith wrote: > 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 thre

threads question

2010-08-12 Thread Ron Smith
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 in