camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
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 <> 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:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
Twitter: davsclaus, fusenews
Author of Camel in Action:

View raw message