ActiveMQ JMS ping

妖精的绣舞 提交于 2020-01-21 11:22:10

问题


Apache Activemq 5.2.0

My application listens to messages on three topics and sends messages on 2 topics. When my application is "webping"ed, I want to check if these topics are alive. I would like to know if this is possible. Here are my observations,

  1. Advisory messages can be used for this, but they send messages only when a producer/consumer joins. This is not quite what I want. I just want to check if I can send messages to outbound topics and can receive messages on the inbound topic.
  2. Custom Heartbeat solution. I can make every producer send a heartbeat message say every 5 seconds and the listener to not process heartbeat messages but update a flag/timestamp. That way I know the topic is up and running.
  3. Is there a heartbeat kinda thingi inbuilt in the Apache ActiveMQ? or a "ping for a topic" ?

I understand JMS is not for monitoring but if I am a producer for a topic, it will be good to know if I can produce on the topic with reasonable comfort level. I also agree between a ping and a message the channel can go down and that is an acceptable failure for me.

I just want a health check system/page which can say "yes topics are there and the activemq is running"


回答1:


You can monitor ActiveMQ using JMX. This will allow you to see if the server is up, what topics/queues are active and a lot of other useful information.



来源:https://stackoverflow.com/questions/2318750/activemq-jms-ping

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