You don't want to create a new producer for every batch of messages. Keeping the producer connection open should be fine.
Thanks, Jun On Wed, Apr 24, 2013 at 11:45 AM, Karl Kirch <kki...@wdtinc.com> wrote: > Is there a best practice on how to handle producer objects for long > running apps? > > Right now I have an app that is long running and will sit for large > stretches of time (days/weeks) with next to none load and then get slammed. > In that case I'd like to cache the producer so I don't incur a hit in > creating a producer connection. Is it a problem to keep that producer > cached? Or should I create a new producer every batch of messages I send? > > Thanks, > Karl