activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aidan <>
Subject What is best practice for creating Producers?
Date Fri, 18 Apr 2008 05:26:39 GMT


I am using ActiveMQ 5 and am having an issue with my server (running
embedded broker) hitting a deadlock with in MemoryUsage.waitForMemory. I
have read the JIRA defects for this, however I have a question about how I
am using Producers in ActiveMQ (the file-system Cursor seems like it would
work nicely, but appears to only be configurable from the XML files, whereas
I use ActiveMQ and programatically configure it).

Each time I want to send a message to the server from my client I create a
new Producer, send the message and close the producer. One of my co-workers
said that he thinks that this sounds like an anti-pattern. After using
JProfiler and seeing how many ProducerId objects are created (and don't
appear to be garbage collected).

So my question is: Should I be creating one producer per queue/topic and
re-using it, or am I able to create one-per-request?


View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message