camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Müller <christian.muel...@gmail.com>
Subject Re: Some Stupid Questions
Date Tue, 04 Aug 2015 19:33:26 GMT
It will create a new instance for each call to the registry. But if you
inject this bean to another bean (which has the singleton scope), than
there is only one instance of this bean.
A workaround could be to call the registry by yourself to get a fresh copy
of this bean.
The solution is to make your bean thread safe. What kind of state do you
have to maintain?

Best,
Christian
-----------------

Software Integration Specialist

Apache Member
V.P. Apache Camel | Apache Camel PMC Member | Apache Camel committer
Apache Incubator PMC Member

https://www.linkedin.com/pub/christian-mueller/11/551/642

On Tue, Aug 4, 2015 at 1:40 PM, fxthomas <felix.thomas@gmail.com> wrote:

> Thanks for your answers I will try them out whatever possible.
>
> I tried the Below things too.
>
> 1) I checked the bean construction the saw that it being created only once
> so i change the bean defination to below
>
> <bean id="CustomProcessorCSV" class="com.XXXX.CustomProcessor"
> scope="prototype">
>       <constructor-arg value="CSV"/>
>     </bean
>
> But still I see only one Instance being created on the Logs, isn',t scope
> prototype supposed to return from registry a new instance so in turn it
> should create multiple instance of the bean. Hope my understanding  is okay
> ?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Some-Stupid-Questions-tp5770217p5770275.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

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