camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: beanRef is caching instances in camel 2.13.0 - unwanted behavior
Date Wed, 21 May 2014 06:50:46 GMT
On Wed, May 21, 2014 at 8:46 AM, cgiera <> wrote:
> We also tried
> bean(Myclass.class, "myMethod");
> bean(new Myclass(), "myMethod");
> beanRef(Myclass.class.getName(), "myMethod", false);
> They all don't work, the instance is everytime the same.
> Just for my understanding, I thought beanRef(...) will create a new instance
> and bean(...) will create a "singleton". This assumption is not 100% correct
> by me, or?
> I'll log a jira ticket.
> I'll also try to apply a patch, but here I need short help:
> As mentioned some posts above, if I change the RegistryBean.getBean() method
> back to the version before CAMEL-6724 everything works fine again.
> Do you think this is the place where the bug exists? If so, I'll investigate
> and try to get the new version running.

No the bean holder should be different that holds a reference to the
class type, that way it becomes a prototype. And maybe the cache
option needs to decide that too, so you can still refer to a type and
have the instance created once and cached.

> kind regards,
> Christoph
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
Red Hat, Inc.
Twitter: davsclaus
Author of Camel in Action:

View raw message