关于WebSphere MQ死信队列与本地队列的区分方法

ww543829 ww543829 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
本人用IBM提供的pcf包,获取WebSphere MQ的队列,现在可以把所有队列都获取到,但是无法区分出哪些队列是死信队列,因为死信队列在大分类里是归属于本地队列的,我想细分出来,不知各位大神有何方式,下面是我取的方法代码:
private static final int[] ATTRS = { 2016, 20, 7, 2002, 2029, 2017, 2018, 2024 };
public static void main(String[] args) throws PCFException, MQException, IOException {
MQUtils mqUtils = new MQUtils();
PCFMessageAgent agent = mqUtils.createMQConnect("192.168.1.199", Integer.parseInt("1414"), MQProductPlugin.Connection_ChanelName);
PCFMessage[] responses = agent.send(getPCFMessage());
for (int i = 0; i < responses.length; i++) {
//该type类型只能区分出大类型队列,
int type = ((Integer)responses[i].getParameterValue(20)).intValue();
//队列名称
String name = (String) responses[i].getParameterValue(2016);

/* Enumeration<?> e = responses[i].getParameters();
while (e.hasMoreElements()) {
PCFParameter p = (PCFParameter) e.nextElement();
if(p.getParameterName().equals("MQCA_Q_NAME")){
//System.out.println(type+":"+p.getStringValue());
}
}*/
}
}
public static PCFMessage getPCFMessage() {
PCFMessage msg = new PCFMessage(13);
msg.addParameter(2016, "*");
msg.addParameter(1002, ATTRS);
return msg;
}
...全文

相关推荐

评论
收藏 已收藏
分享
返回顶部
ww543829
Java 51,407 成员 86,128 内容