ActiveMQ async statistics receiving

我怕爱的太早我们不能终老 提交于 2019-12-11 14:07:09

问题


I am facing a pretty common error, but still haven't found a solution for it. I am using async message sending:

    Queue adminQueue=session.createQueue("admin_queue");
    MessageConsumer mc=session.createConsumer(adminQueue);              
    mc.setMessageListener(new AdminListener(emfMaster,ps));
    connection.start();

    this.statisticProvider = new AdminStats(adminQueue, mc, session);       

And I need to receive statstics for it, using a Stat Plugin for ActiveMQ, which is stuffed into my AdminStats class(it starts a new thread for receiving stats), but still it tells, that I can use only sync message sending, not specifying the MessageListener.

[javax.jms.IllegalStateException: Cannot synchronously receive a message when a MessageListener is set]

I have no right to change the way messages are sent. Is there any way to get the stats in async way?


回答1:


You can get stats using JMX. Or with advisory messages. Some links from here: http://activemq.apache.org/how-can-i-monitor-activemq.html



来源:https://stackoverflow.com/questions/12937705/activemq-async-statistics-receiving

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!