activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cooshal <kushal.gau...@gmail.com>
Subject Is it possible to retrieve more than 400 messages from ActiveMQ queue via Jolokia API?
Date Tue, 16 Apr 2019 13:23:15 GMT
I have a custom error queue in ActiveMQ, which is populated by Apache Camel's
onException(..) error handler. There can be thousands of messages in this
queue.

Instead of using the ActiveMQ web console, I am building a custom web admin
to integrate several other statistics from other components as well. Thus, I
wanted to include the statistics from ActiveMQ as well.

I am using ActiveMQ version 5.14.3

I have looked at Jolokia JMX API, and its operations. For instance, I have
the following payload to the broker's Jolokia API endpoint:

{
    "type": "exec",
    "mbean":
"org.apache.activemq:type=Broker,brokerName=localhost,destinationType=Queue,destinationName=test.errors",
    "operation": "browse(java.lang.String)",
    "arguments": ["EXCEPTION_TYPE LIKE '%jdbc%'"]
}

The header field EXCEPTION_TYPE is already populated via Apache Camel Route.
I have more than 10k messages in this queue at the moment. I made a POST
request to my broker API endpoint with the payload as shown above. Although
I had more than 10k messages, this request resulted in just 400 messages
(due to the max page size limitation, hard coded in the source code
[https://github.com/apache/activemq/blob/master/activemq-broker/src/main/java/org/apache/activemq/broker/region/BaseDestination.java#L58]).
This means that I will not be able to get more than 400 messages at a time
via Jolokia. I also tried the browseMessages() method as well. Looks like,
it does the same thing, in general.

1. Is it possible to browse these messages (let's say if they are high in
number, may be around 10k+)?
2. Or, is it possible to paginate them? I could not see a relevant operation
method for that.
I tried to see if Hawtio did something special in retrieving all the
messages. But, the result is same( with max 400 messages).

ActiveMQ web console does fetch all the messages. This probably could be
because it is tightly coupled with the ActiveMQ project.

I am not restricted to just JMX/Jolokia. If these stats can be fetched via
some API, its equally fine.



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

Mime
View raw message