camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brad Johnson <>
Subject Re: ProducerTemplate creates too much threads
Date Fri, 09 Sep 2016 16:37:26 GMT
OK, but that doesn't apply to an inject ProducerTemplate in a bean, only to
ones created on the incoming thread.

If you have something like. It is an *instance *variable. It is not created
on the incoming thread but is only created at start up time.

public class FooHandler {

  ProducerTemplate producer;

  public void doSomething() {
    if (whatever) {

Make sure you look at what they are conveying.  This not suggesting that
you create a singleton and serve up ProducerTemplates from it.  It is
saying you shouldn't create them inside the invocation (on the incoming
thread).  Specifically it says: *You are not meant to create a
ProducerTemplate for each message invocation; you are meant to create a
single instance on startup and keep it around.*

On Thu, Sep 8, 2016 at 10:50 PM, niteshjain <> wrote:

> Hi,
> Can you please look into this query:
> producer-templates-often-td5787400.html
> any help is appreciated.
> Thanks,
> Nithesh
> --
> View this message in context: http://camel.465427.n5.nabble.
> com/ProducerTemplate-creates-too-much-threads-tp5751299p5787401.html
> Sent from the Camel - Users mailing list archive at

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