简体   繁体   English

通过 TCP 连接使用 Jolokia 检查 AMQ Artemis 代理是否健康

[英]Check if AMQ Artemis broker is healthy using Jolokia through TCP connection

We have an Openshift project ( project1 ) in which we setup an AMQ Artemis broker using the image : amq- amq-broker-7-tech-preview/amq-broker-71-openshif .我们有一个 Openshift 项目 (project1),我们在其中使用图像设置了一个 AMQ Artemis 代理:amq-amq-broker-7-tech-preview/amq-broker-71-openshif。 Being the basic image we don't have any configuration such as SSL or TLS.作为基本映像,我们没有任何配置,例如 SSL 或 TLS。 In order to do the setup we used as example : https://github.com/jboss-container-images/jboss-amq-7-broker-openshift-image/blob/amq71-dev/templates/amq-broker-71-basic.yaml为了进行我们用作示例的设置: https : //github.com/jboss-container-images/jboss-amq-7-broker-openshift-image/blob/amq71-dev/templates/amq-broker-71 -basic.yaml

After the deployment of the image on Openshift we have the following:在 Openshift 上部署映像后,我们有以下内容:

  • broker-amq-amqp (5672/TCP 5672) No route broker-amq-amqp (5672/TCP 5672) 无路由
  • broker-amq-jolokia (8161/TCP 8161) No Route broker-amq-jolokia (8161/TCP 8161) 无路由
  • broker-amq-mqtt ( 1883/TCP 1883 ) No route broker-amq-mqtt (1883/TCP 1883) 无路由
  • broker-amq-stomp ( 61613/TCP 61613 ) No route broker-amq-stomp (61613/TCP 61613) 无路由
  • broker-amq-tcp ( 61616/TCP 61616 ) No route broker-amq-tcp (61616/TCP 61616) 无路由

My question is : how we can check if the broker is healthy using the TCP connection to broker-amq-jolokia ?我的问题是:我们如何使用与 broker-amq-jolokia 的 TCP 连接来检查代理是否健康? So far we connected using TCP Sockets in Java to broker-amq-jolokia but we don't know what message in order for Jolokia to respond with the health status of the broker到目前为止,我们使用 Java 中的 TCP 套接字连接到 broker-amq-jolokia,但我们不知道什么消息才能让 Jolokia 以代理的健康状态进行响应

ActiveMQ Artemis has a lot of beans exposed by jolokia and they can be used to perform the required health checks. ActiveMQ Artemis 有很多由 jolokia 公开的 bean,它们可用于执行所需的健康检查。

For a standalone broker could be useful to check:对于独立的经纪人,检查可能很有用:

  • the broker is started console/jolokia/read/org.apache.activemq.artemis:broker=\\"$BROKER_NAME\\"/Started代理启动console/jolokia/read/org.apache.activemq.artemis:broker=\\"$BROKER_NAME\\"/Started
  • the disk store usage console/jolokia/read/org.apache.activemq.artemis:broker=\\"$BROKER_NAME\\"/DiskStoreUsage磁盘存储使用console/jolokia/read/org.apache.activemq.artemis:broker=\\"$BROKER_NAME\\"/DiskStoreUsage
  • the address memory usage console/jolokia/read/org.apache.activemq.artemis:broker=\\"$BROKER_NAME\\"/AddressMemoryUsagePercentage地址内存使用console/jolokia/read/org.apache.activemq.artemis:broker=\\"$BROKER_NAME\\"/AddressMemoryUsagePercentage

For a cluster of brokers could be useful to check the topology: console/jolokia/exec/org.apache.activemq.artemis:broker=\\"$BROKER_NAME\\"/listNetworkTopology对于代理集群,检查拓扑可能很有用: console/jolokia/exec/org.apache.activemq.artemis:broker=\\"$BROKER_NAME\\"/listNetworkTopology

All this checks and others can be executed using the tool artemis check , ie:所有这些检查和其他检查都可以使用工具artemis check执行,即:

./bin/artemis check queue --name TEST --produce 1000 --browse 1000 --consume 1000 --url tcp://$BROKER_IP:61616

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

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