如何从代码级别识别 websphere MQ 侦听器端口已关闭
我想监控 mq 侦听器状态是启动还是关闭。如果连接断开,我想跟踪它并通过我的程序进行相应的更改。有没有办法使用java来实现这一点?
I want to monitor mq listener status whether is up or down. If the connection is down i want to track it down and made a changes accordingly through my program. Is there a way to achieve this using java ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果使用 Websphere MQ,我会考虑以这种方式监视您的侦听器:
您可以使用称为 websphere PCF 的可编程命令格式向侦听器发送消息。
可能的用途
这些 PCF 类可用于开发用于通用 WebSphere MQ 管理和监视的应用程序,或者用于需要查询或更改 WebSphere MQ 定义的专用应用程序。
http://www-01.ibm.com/support/docview.wss ?uid=swg24000668
I would consider monitoring your listener this way if using Websphere MQ :
You can send messages to your listener with Programmable Command Formats known as websphere PCF.
Possible Uses
These PCF classes can be used to develop applications for general-purpose WebSphere MQ administration and monitoring, or in specialized applications that need to query or alter WebSphere MQ definitions.
http://www-01.ibm.com/support/docview.wss?uid=swg24000668
您还可以使用 MBean(我们过去在切换到 SIBus 之前就是这样做的)。 MBean 类型一度被命名为“ListenerPort”。
如果您想使用 Java 代码,您可以通过 jar 访问 AdminClient。对于 WebSphere 版本 7,该类似乎位于 com.ibm.ws.admin.core.jar 中(应该位于您的 WebSphere 安装中的某个位置,甚至位于 Rational Application Developer 或 Rational Software Architect 的安装中,如果您使用其中任何一个)。
不管怎样,一旦您查找到想要运行的 MBean,
我们就是这样做的。
You can also use MBeans (we did in the past before we switched to SIBus). At one time the MBean type was named "ListenerPort".
If you want to use Java code you can access the AdminClient through a jar. For WebSphere version 7, it looks like that class is in the com.ibm.ws.admin.core.jar (should be somewhere in your WebSphere installation, or even in your install for Rational Application Developer or Rational Software Architect, if you use either of those).
Anyway, once you've looked up the MBean you want to run
That's how we did it.