Multiple camel producers instantiated

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiple camel producers instantiated

Shiva
I am using apache camel 2.16.4. The issue I am having is the case where multiple producers are created for the same endpoint. I see the problem exists in doGetProducer() in org.apache.camel.impl.ProducerCache in the line answer = pool.acquire(endpoint);
The endpoint is trying to be acquired before it is released. Because of the asynchronized approach there are multiple producer objects instantiated. Could someone help me with this?
Reply | Threaded
Open this post in threaded view
|

Re: Multiple camel producers instantiated

John Poth
Hi Shiva,

Not sure what Producer you're talking about but you might want to check out
the isSingleton property [1] on some Producers/Endpoints which affects
instance creation (returning true will only create one).

Hope this helps,

John.

[1]
https://github.com/apache/camel/blob/041e98bfaf45fd3929095e46e274547ad4f52d1e/camel-core/src/main/java/org/apache/camel/IsSingleton.java#L40

On Thu, Feb 23, 2017 at 2:24 PM, Shiva <[hidden email]> wrote:

> I am using apache camel 2.16.4. The issue I am having is the case where
> multiple producers are created for the same endpoint. I see the problem
> exists in doGetProducer() in org.apache.camel.impl.ProducerCache in the
> line
> answer = pool.acquire(endpoint);
> The endpoint is trying to be acquired before it is released. Because of the
> asynchronized approach there are multiple producer objects instantiated.
> Could someone help me with this?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.
> com/Multiple-camel-producers-instantiated-tp5794353.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Multiple camel producers instantiated

Shiva
Hi John,

The endpoint is already a Singleton. The issue doesn't happen when I start the application. The application starts with an Endpoint creating a producer for that endpoint. But after a some messages are successfully produced and consumed, there is another Producer instantiated when a message was sent.

Thanks!