You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by gilboy <jo...@gmail.com> on 2012/11/30 18:01:41 UTC

Singleton Endpoint Question

Hi

If an endpoint is defined to be a singleton and you have 2 camel routes both
referencing the same endpoint URI, will camel call endpoint.createConsumer()
once or twice?

Thanks
Joe



--
View this message in context: http://camel.465427.n5.nabble.com/Singleton-Endpoint-Question-tp5723464.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Singleton Endpoint Question

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Nov 30, 2012 at 6:01 PM, gilboy <jo...@gmail.com> wrote:
> Hi
>
> If an endpoint is defined to be a singleton and you have 2 camel routes both
> referencing the same endpoint URI, will camel call endpoint.createConsumer()
> once or twice?
>

Twice.

Each route needs their own consumer, so createConsumer is always invoked.

If the endpoint is singleton, then they use the same instance of the endpoint.
If the endpoint is not singleton, then a new endpoint instance is
always created when needed.


> Thanks
> Joe
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Singleton-Endpoint-Question-tp5723464.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen