Hi,I'm using Artemis 1.2.0 with an embedded broker and I'm following the
documented code under "Using Management Via JMS" so I have this to get the
message count:
try ( QueueSession session =
connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); ) {
Queue managementQueue =
ActiveMQJMSClient.createQueue("activemq.management"); QueueRequestor
requestor = new QueueRequestor(session, managementQueue); Message
message = session.createTextMessage();
JMSManagementHelper.putAttribute(message, "jms.queue.exampleQueue",
"messageCount"); Message reply = requestor.request(message);
requestor.close(); return (int) (Integer)
JMSManagementHelper.getResult(reply); } catch (Exception e) {
throw propagate(e); }
After introducing this code I would eventually get an OOM in my app, profiling
revealed certain instances were going up each time it was called and never went
down after GC, e.g.:
org.apache.activemq.artemis.utils.LinkedListImplorg.apache.activemq.artemis.utils.LinkedListImpl$Nodeorg.apache.activemq.artemis.utils.LinkedListImpl$Iterator
I do not see this behaviour with other code reading and writing to queues in my
app. Let me know if you need more details to investigate.
Thanks,Andy