英文:
How to access all the queue managers by connecting to the IBM MQ Server using IBM MQ classes in java
问题
我一直在尝试通过提供服务器详细信息而不提供队列管理器名称来查找IBM MQ服务器内的所有队列管理器。
思路是:
- 我有一个包含服务器详细信息的属性文件 - 主机、端口号、通道、用户ID、密码。
- 使用这些信息,我们需要连接到服务器并查找服务器中所有可用的队列管理器。
- 我需要在Java中使用IBM MQ类。
由于我们有办法查找队列管理器内的所有队列,所以我们是否可以类似地查找所有队列管理器?
英文:
I have been trying to find all the queue managers inside IBM MQ Server by giving server details without queue manager name.
The idea is :
- I have a properties file having server details- host, port number, channel, userid, passwrd.
- By using this info we need to connect to the server and find all the queue managers available in the server.
- I need to use IBM MQ classes in java.
As we have ways to find all the queues inside a queue manager can we do similarly to find all queue managers?
答案1
得分: 3
PCF操作,如获取队列列表,需要您首先连接到队列管理器。要获取机器上队列管理器的列表,需要使用操作系统级别的命令。可以通过以下几种方式来实现:
- 运行
dspmq
(如果您可以确定其位置 - 不能假设它总是在 /opt/mqm/bin 中,并且可能需要使用 setmqenv 来为其提供可工作的环境),然后解析输出 - 直接解析
/var/mqm/mqs.ini
(在Windows上更具挑战性,甚至在z/OS上更糟糕)。
如果您尝试远程执行此操作,那么您需要将其封装在类似于SSH的东西中。
英文:
No.
PCF operations like getting the list of queues require you to connect to a queue manager first. To get the list of queue managers on a machine requires OS-level commands instead. A couple of ways that can be done
- run
dspmq
(if you can work out where it might be - cannot assume it's always in /opt/mqm/bin and might require setmqenv to give it a workable environment) and then parse the output - directly parse
/var/mqm/mqs.ini
(more challenging on Windows or even worse on z/OS).
And if you're trying to do it remotely, then you have to wrap it up in something like ssh.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论