activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bobsponge <ruben.gar...@tecnicasdeingenieria.com>
Subject About statistics and statisticsBrokerPlugin
Date Wed, 19 May 2010 12:58:30 GMT

Hi all, 

some time ago I needed to collect some statistical information from some
queues and I did some tests with JMX integration in my java application and
It worked fine. Some days ago I updated my application to Activemq 5.3.2 and
I found it was possible to collect the same information using
statisticsBroker plugin. I've done some tests but I've found and strange
behaviour that I don't  completely understand. In a simplified way, I have
one queue where some data is stored periodically by a producer. As I need to
know quite frequently the number of stored messages and some other
statistical data from that queue I adapted the example code for retrieving
data from a destination using the statisticsBrokerPlugin this way:


Queue replyTo = session.createTemporaryQueue();
MessageConsumer consumer = session.createConsumer(replyTo);

String queueName = "ActiveMQ.Statistics.Destination" +
queuesList[0].getQueueName(); //get the name of the destination queue
Queue query = session.createQueue(queueName);

Message msg = session.createMessage();
msg.setJMSReplyTo(replyTo);
producer.send(query, msg);

MapMessage reply = (MapMessage) consumer.receive();
        
//code for collecting the queue size value


The messages and posted in the target queue correctly and the statistics are
collected fine, as well. But the problem appears when I remove messages from
the destination queue (or I drain it)  and I restart the java application.
When the application starts again none of the messages seems to be removed
from the queue, the size is the same as before and I can get messages from
the queue even when it was drained. Before restarting the application, the
queue size value is zero and I can't get any message from the queue... 

I suspect the problem is related to the "ActiveMQ.Statistics.Destination" +
queuesList[0].getQueueName() created, but I don't know why.

Does anybody know where is the problem?

Thank you
-- 
View this message in context: http://old.nabble.com/About-statistics-and-statisticsBrokerPlugin-tp28607865p28607865.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message