You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by cmathrusse <ch...@veeva.com> on 2020/01/14 18:33:08 UTC

Problem retrieving JMXQueueStatistics with MBeanServerConnection

We're running ActiveMQ 5.15.3 within a docker container and I have just
switched over to using mysql as the persistence store. The problem I am
having is retrieving JMXQueueStatistics when performing a query. I have
messages sitting in the queue which are ready for consumption but when I
perform a query and expect to retrieve results I am getting an empty set.

MBeanServerConnection activeMQConnection =
activeMQJMXManager.getActiveMQJMXConnection();
Set<ObjectName>  instanceObjectNameSet =
activeMQConnection.queryNames(objectNameRequest, filterQueryExpr);

The objectNameRequest contains the following:
*org.apache.activemq:type=Broker,destinationType=Queue,destinationName=instance_*.xxxxx.CacheEvictionJobQueue*

And the filterQueryExpr contains the following:
*(QueueSize) > (0)*

This results in an empty set being returned when I would expect 2 records
retrieved. The data contained within the ACTIVEMQ_MSGS tables is as follows:
<http://activemq.2283324.n4.nabble.com/file/t379719/ACTIVEMQ_MSGS-CacheEvictionJobQueue.png> 

I've enabled trace logging but I don't see anything obvious as to why these
rows are not returned from my query. There are a few lines making reference
to CacheEvictionJobQueue but I'm uncertain if they indicate a cause as to
why the rows are not returned:


2020-01-14 18:04:15,546 | DEBUG |
queue://instance_1000019.CacheEvictionJobQueue expiring messages .. |
org.apache.activemq.broker.region.Queue | ActiveMQ Broker[my.broker]
Scheduler
2020-01-14 18:04:15,546 | TRACE | max 400, alreadyPagedIn 2, messagesCount
2, memoryUsage 0% | org.apache.activemq.broker.region.Queue | ActiveMQ
Broker[my.broker] Scheduler
2020-01-14 18:04:15,546 | DEBUG |
queue://instance_1000019.CacheEvictionJobQueue expiring messages done. |
org.apache.activemq.broker.region.Queue | ActiveMQ Broker[my.broker]
Scheduler
2020-01-14 18:04:15,546 | TRACE | Running task iteration 0 -
queue://instance_1000019.CacheEvictionJobQueue, subscriptions=0, memory=0%,
size=2, pending=0 | org.apache.activemq.thread.         PooledTaskRunner |
ActiveMQ BrokerService[my.broker] Task-4
2020-01-14 18:04:15,546 | DEBUG |
queue://instance_1000019.CacheEvictionJobQueue, subscriptions=0, memory=0%,
size=2, pending=0 toPageIn: 0, force:false, Inflight: 0,
pagedInMessages.size 2,   pagedInPendingDispatch.size 2, enqueueCount: 0,
dequeueCount: 0, memUsage:5612, maxPageSize:200 |
org.apache.activemq.broker.region.Queue | ActiveMQ BrokerService[my.broker]
Task-4
2020-01-14 18:04:15,546 | TRACE | Run task done:
queue://instance_1000019.CacheEvictionJobQueue, subscriptions=0, memory=0%,
size=2, pending=0 | org.apache.activemq.thread.PooledTaskRunner |   ActiveMQ
BrokerService[my.broker] Task-4


Thank you for your assistance.





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

Re: Problem retrieving JMXQueueStatistics with MBeanServerConnection

Posted by Tim Bain <tb...@alumni.duke.edu>.
This is why I hate interacting with JMX via code, especially since I only
do it once every few years. It's very useful, but I always find that I have
to troubleshoot every step of the way because it's not very intuitive (to
me).

Glad you found the solution.

Tim

On Wed, Jan 15, 2020, 4:58 PM cmathrusse <ch...@veeva.com> wrote:

> I found the issue. The client code was building the JMX query with a hard
> coded value for the brokerName. Changes to the broker resulted in the
> broker
> Id being dynamic when the container was provisioned so the hard code value
> on the client side was no longer value. The fix was simple and only
> required
> the following change: brokerName=*
>
>
>
> --
> Sent from:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>

Re: Problem retrieving JMXQueueStatistics with MBeanServerConnection

Posted by cmathrusse <ch...@veeva.com>.
I found the issue. The client code was building the JMX query with a hard
coded value for the brokerName. Changes to the broker resulted in the broker
Id being dynamic when the container was provisioned so the hard code value
on the client side was no longer value. The fix was simple and only required
the following change: brokerName=*



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