camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: ClassCastException using cxf:bean
Date Tue, 29 May 2012 12:49:49 GMT
On Tue, May 29, 2012 at 2:44 PM, cgiera <christoph.giera@mic-cust.com> wrote:
>
> Claus Ibsen-2 wrote
>>
>> When using .bean in the DSL, then the bean is looked up / created once
>> / etc when the route is being initialized / started.
>> And thus there is no thread safe issue at runtime, as the beans is
>> already created.
>>
>> When using bean with a class type, the bean is created once (eg
>> singleton scope).
>> And that is by design.
>>
>> If you want prototype scope or something like that, then use a beanRef
>> and refer to a bean in a bean container that supports that such as
>> spring etc.
>>
>>
> Yes, I use beanRef, but when I use the cxf-Endpoint I still have multi
> threading problems. The method RegistryBean.getBean() is - as i mentioned
> above - not thread safe I think.
>
> Do you agree with that, or is something wrong with my assumptions?
>

You use an old version of Camel. You can upgrade to have this fixed.


When Camel start the routes it initializes the resources and thus also
bean / beanRef, where it will setup this logic.
That logic runs single threaded.



> kind regards,
> Christoph
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/ClassCastException-using-cxf-bean-tp5599810p5713678.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Mime
View raw message