如何使用可编程命令格式获取MQ集群信息?

编程入门 行业动态 更新时间:2024-10-23 01:48:41
本文介绍了如何使用可编程命令格式获取MQ集群信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个mq集群设置,其中有几个队列管理器,一些是完整的存储库,有些是部分存储库. 完整的存储库应该保存有关整个集群的信息(元数据?). 部分存储库将保存有关集群的一些信息. 如何使用可编程命令格式收集有关整个集群的信息? 有关主机,队列管理器,完整和部分存储库,集群队列等的信息.

I have a mq cluster setup that has a few queue managers, some are full repositories and some are partial repositories. A full repository is supposed to hold information(meta data?) about the entire cluster. A partial repository will hold some information about the cluster. How do I gather information about the entire cluster using Programmable Command Format? Information about hosts, queue managers, full and partial repositories, cluster queues etc....

更新1 我已经尝试了以下代码,但这不会返回群集信息.

Update 1 I have tried the following code but this does not return cluster information.

PCFMessageAgent agent = new PCFMessageAgent(queueManager); agent.setCheckResponses(false); PCFMessage[] responses; PCFMessage request = new PCFMessage(MQConstants.MQCMD_INQUIRE_CLUSTER_Q_MGR); request.addParameter(MQConstants.MQCA_CLUSTER_Q_MGR_NAME, queueManager); responses = agent.send(request); String clusterName = (String)responses[0].getParameterValue(MQConstants.MQCA_CLUSTER_NAME); String clusterInfo = (String)responses[0].getParameterValue(MQConstants.MQIACF_CLUSTER_INFO); logger.info("Cluster Name [" + clusterName + "]"); logger.info("Cluster Information [" + clusterInfo + "]");

最后一行显示空值.

更新2 以下答案表明MQCMD_INQUIRE_CLUSTER_Q_MGR等效于runmqsc DISPLAY CLUSQMGR(*)命令.以下是该命令的输出

Update 2 The answer below suggests that MQCMD_INQUIRE_CLUSTER_Q_MGR is equivalent to runmqsc DISPLAY CLUSQMGR(*) command. Following is the output from this command

display clusqmgr(*) 4 : display clusqmgr(*) AMQ8441: Display Cluster Queue Manager details. CLUSQMGR(QM_FR1) CHANNEL(TO.QM_FR1) CLUSTER(CLUSTER1) AMQ8441: Display Cluster Queue Manager details. CLUSQMGR(QM_FR2) CHANNEL(TO.QM_FR2) CLUSTER(CLUSTER1) AMQ8441: Display Cluster Queue Manager details. CLUSQMGR(QM_PR1) CHANNEL(TO.QM_PR1) CLUSTER(CLUSTER1) AMQ8441: Display Cluster Queue Manager details. CLUSQMGR(QM_PR2) CHANNEL(TO.QM_PR2) CLUSTER(CLUSTER1) AMQ8441: Display Cluster Queue Manager details. CLUSQMGR(QM_PR3) CHANNEL(TO.QM_PR3) CLUSTER(CLUSTER1) AMQ8441: Display Cluster Queue Manager details. CLUSQMGR(QM_PR3) CHANNEL(TO.QM_PR3) CLUSTER(CLUSTER1)

我期望我提供的代码中PCF会有类似的响应,但是我没有得到此信息. 所以问题是 如何使用PCF获取此信息?以上输出是针对完整的存储库队列管理器的.

I was expecting a similar response with PCF in the code i have supplied, but i don't get this information. So the question is How do I get this information using PCF? The above output is for a full repository queue manager.

推荐答案

使用以下PCF命令

  • 查询集群队列管理器( MQCMD_INQUIRE_CLUSTER_Q_MGR ),它等效于MQSC命令DISPLAY CLUSQMGR.在链接的页面中,您可以看到在以ClusterQMgrAttrs为标题的部分中列出的所有可能的输出参数.您可以删除代码中试图检索MQIACF_CLUSTER_INFO的值的行-一个 INPUT-ONLY 参数-并将该行替换为该部分列出的任何参数,以检索任何信息.您就是想要这个集群队列管理器.
  • 查询队列( MQCMD_INQUIRE_Q ),与MQSC命令DISPLAY QUEUE(*) CLUSINFO等效.请注意,MQIACF_CLUSTER_INFO参数是此命令的输入限定符,它将导致集群队列以及本地队列作为答案返回.
  • Inquire Cluster Queue Manager (MQCMD_INQUIRE_CLUSTER_Q_MGR) which is the equivalent of the MQSC command DISPLAY CLUSQMGR. In the linked page, you can see all the possible output parameters listed in the section headed with ClusterQMgrAttrs. You can remove the line in your code that is trying to retrieve the value of the MQIACF_CLUSTER_INFO - an INPUT-ONLY parameter - and replace that line with any one of the parameters listed in that section to retrieve whatever information it is that you want about this cluster queue manager.
  • Inquire Queue (MQCMD_INQUIRE_Q) with the MQIACF_CLUSTER_INFO parameter which is the equivalent of the MQSC command DISPLAY QUEUE(*) CLUSINFO. Please note, the MQIACF_CLUSTER_INFO parameter is an input qualifier to this command that causes cluster queues as well as local queues to be returned as answers.

您正确地注意到,只有完整的存储库队列管理器才知道有关集群的所有信息,因此您需要向该队列管理器进行查询以获取全部信息.

As you correctly note, only the full repository queue manager knows everything about a cluster, so you need to make your inquiries against that queue manager in order to get the full picture.

更多推荐

如何使用可编程命令格式获取MQ集群信息?

本文发布于:2023-06-04 08:34:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/493341.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:可编程   集群   如何使用   命令   格式

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!