IBM MQ Monitor
来源:互联网 发布:163k门户系统源码 x6 编辑:程序博客网 时间:2024/05/21 00:18
通过MQQueueManager获取所有的Queue列表,采用命令行的方式
package com.iss.ibm.monitor;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import com.ibm.mq.MQC;
import com.ibm.mq.MQException;
import com.ibm.mq.MQQueueManager;
import com.ibm.mq.pcf.CMQC;
import com.ibm.mq.pcf.CMQCFC;
import com.ibm.mq.pcf.PCFMessage;
import com.ibm.mq.pcf.PCFMessageAgent;
@SuppressWarnings("deprecation")
public class QueueManagerMonitor
{
private String host;
private Integer port;
private String transport = "MQSeries";
private String channel = "SYSTEM.DEF.SVRCONN";
private Integer CCSID = 950;
private String username;
private String password;
public QueueManagerMonitor(String host, Integer port, String username,
String password, String qMName) {
super();
this.host = host;
this.port = port;
this.username = username;
this.password = password;
this.qMName = qMName;
}
private String qMName = "QM_S11101";
/**
* 获取MQQueueManager对象
* @author 王成(chengwangi@isoftstone.com)
* @date 2012-11-16 上午10:01:13
* @return
* @throws MQException
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
public MQQueueManager getQueueManager() throws MQException
{
Hashtable properties = new Hashtable();
properties.put("hostname", host);
properties.put("transport", transport);
properties.put("channel", channel);
properties.put("port", port);
properties.put("CCSID", CCSID);
properties.put("username", username);
properties.put("password", password);
return new MQQueueManager(qMName, properties);
}
/**
* 通过MQQueueManager获取其下所有Queue的名称
* @author 王成(chengwangi@isoftstone.com)
* @date 2012-11-16 上午10:01:25
* @param qManager
* @return
* @throws MQException
* @throws IOException
*/
public List<String> getQueueNames(MQQueueManager qManager) throws MQException, IOException
{
List<String> qNames = new ArrayList<String>();
PCFMessageAgent agent = new PCFMessageAgent(qManager);
PCFMessage request = new PCFMessage (CMQCFC.MQCMD_INQUIRE_Q_NAMES);
request.addParameter (CMQC.MQCA_Q_NAME, "*");
request.addParameter (CMQC.MQIA_Q_TYPE, MQC.MQQT_LOCAL);
PCFMessage [] responses = agent.send (request);
String [] names = (String []) responses [0].getParameterValue (CMQCFC.MQCACF_Q_NAMES);
for (int i = 0; i < names.length; i++)
{
qNames.add(names[i]);
}
return qNames;
}
}
- IBM MQ Monitor
- IBM MQ Queue Monitor
- IBM MQ
- IBM MQ 使用指南
- IBM MQ 介绍
- IBM MQ介绍
- IBM MQ 使用指南
- IBM MQ 使用指南
- IBM MB MQ简介
- IBM WebSphere MQ监控
- ibm MB MQ
- IBM Websphere MQ
- IBM WebSphere MQ安装
- IBM WebSphere MQ
- 初探IBM Websphase MQ
- IBM MQ 学习、应用
- WebSphere MQ ibm[转]
- java连接ibm mq
- SSH常见jar包的作用
- Android使用ViewFlipper实现左右滑动效果面
- android 更改当前界面亮度
- Spring注解@Component、@Repository、@Service、@Controller区别
- 关于wince6.0 摄像头驱动分辨率设置,尤其是scaler功能使用的认识
- IBM MQ Monitor
- LINUX查看硬件配置命令
- MySQL数据类型简介
- Android仿系统Menu的代码
- [Java] 从图片URL中读取字节数组
- Android视频播放
- ulimit
- 【Web Trick 4】CSS 实现footer固定页面底部
- C#完整的通信代码(点对点,点对多,同步,异步,UDP,TCP)