You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by atluris <at...@gmail.com> on 2016/08/31 06:33:55 UTC

when to call start() and stop() on ProducerTemplate?

Hi,

Based on below article, we are creating single producer template instance
and using it as and when needed to execute the camel route explicitly.

http://camel.apache.org/why-does-camel-use-too-many-threads-with-producertemplate.html

We are calling start() during server startup and stop() during shutdown. Is
that fine, or do we need to call start() and stop() during each message
invocation?

Thanks & Regards,
Srinivas Atluri.



--
View this message in context: http://camel.465427.n5.nabble.com/when-to-call-start-and-stop-on-ProducerTemplate-tp5787020.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: when to call start() and stop() on ProducerTemplate?

Posted by Claus Ibsen <cl...@gmail.com>.
Yes that is fine to only call stop on server shutdown.
Then you can reuse the same producer template.

Only if you do not use the template anymore you can call stop before.


On Wed, Aug 31, 2016 at 8:33 AM, atluris <at...@gmail.com> wrote:
> Hi,
>
> Based on below article, we are creating single producer template instance
> and using it as and when needed to execute the camel route explicitly.
>
> http://camel.apache.org/why-does-camel-use-too-many-threads-with-producertemplate.html
>
> We are calling start() during server startup and stop() during shutdown. Is
> that fine, or do we need to call start() and stop() during each message
> invocation?
>
> Thanks & Regards,
> Srinivas Atluri.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/when-to-call-start-and-stop-on-ProducerTemplate-tp5787020.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2