简体   繁体   English

ActiveMQ JMS ping

[英]ActiveMQ JMS ping

Apache Activemq 5.2.0 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. 当我的应用程序是“webping”时,我想检查这些主题是否还活着。 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. 我可以让每个生产者发送一个心跳消息说每5秒钟,并且监听器不处理心跳消息但更新标志/时间戳。 That way I know the topic is up and running. 这样我就知道这个话题正在运行。
  3. Is there a heartbeat kinda thingi inbuilt in the Apache ActiveMQ? 在Apache ActiveMQ中是否有内置的心跳? or a "ping for a topic" ? 或者“ping一个主题”?

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. 我理解JMS不是用于监控,但如果我是一个主题的制作人,那么知道我是否能够以合理的舒适程度制作主题将是一件好事。 I also agree between a ping and a message the channel can go down and that is an acceptable failure for me. 我也同意ping和消息,频道可以关闭,这对我来说是一个可接受的失败。

I just want a health check system/page which can say "yes topics are there and the activemq is running" 我只想要一个健康检查系统/页面,可以说“是的主题在那里,activemq正在运行”

You can monitor ActiveMQ using JMX . 您可以使用JMX监视ActiveMQ。 This will allow you to see if the server is up, what topics/queues are active and a lot of other useful information. 这将允许您查看服务器是否已启动,哪些主题/队列处于活动状态以及许多其他有用信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM