activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cooshal <kushal.gau...@gmail.com>
Subject JMS QueueBrowser does not return actual number of messages in the queue
Date Wed, 19 Jun 2019 16:13:05 GMT
Hi:

I am using ActiveMQ version 5.15.8

I have the following code fragment, which is basically there to count the
number of messages in a particular queue (here, it is tst.errors)

brokerConnection = connectionFactory.createConnection();
session = this.createSession(brokerConnection);
brokerConnection.start();

if (selector == null) {
    selector = "";
}

Queue queue = session.createQueue("tst.errors");
queueBrowser = session.createBrowser(queue, selector);

Enumeration e = queueBrowser.getEnumeration();
while (e.hasMoreElements()) {
    e.nextElement();
    queueEntriesCount++;
}

But, this does not retrieve messages more than 400. I knew that this was a
problem with the Jolokia API of ActiveMQ. But, I did not realize that there
was similar limitation with JMS API as well. Is there a way to retrieve all
the messages via JMS API?

Regards,
Cooshal.



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Mime
View raw message