gpt4 book ai didi

java - 获取 WebSphere MQ 消息头

转载 作者:太空宇宙 更新时间:2023-11-04 06:32:48 25 4
gpt4 key购买 nike

我想列出邮件的标题。但是当我使用 IBM 提供的代码时,永远不会进入循环:

...
int openOptions = MQConstants.MQOO_INPUT_AS_Q_DEF;
MQQueue queue = qMgr.accessQueue(qName, openOptions);
...
MQMessage rcvMessage = new MQMessage();
MQGetMessageOptions gmo = new MQGetMessageOptions();
queue.get(rcvMessage, gmo);
MQHeaderIterator it = new MQHeaderIterator(rcvMessage);
while (it.hasNext()) {
MQHeader header = it.nextHeader();
System.out.println("Header type " + header.type() + ": " + header);
}
...

有人知道我的错误在哪里吗?

这是使用 qload 读取的消息:

A VER 2
A RPT 0
A MST 8
A EXP -1
A FDB 0
A ENC 273
A CCS 819
A FMT
A PRI 0
A PER 0
A MSI 414D5120574D42514D3144312020202035E2165414530020
A COI 000000000000000000000000000000000000000000000000
A BOC 0
A RTQ
A RTM WMBQM1D1
A USR lanes
A ACC 0000000000000000000000000000000000000000000000000000000000000000
A AID
A PAT 28
A PAN mq.MQ
A PTD 20140916
A PTT 11415704
A AOD
A GRP 000000000000000000000000000000000000000000000000
A MSQ 1
A OFF 0
A MSF 0
A ORL -1
X 000D48656C6C6F2C20576F726C6421

最佳答案

Calanais给出了答案:消息描述符不被归类为 header 。

这是一个table标题数量:

Header  Header Description  Format Name

MQCIH CICS information header MQFMT_CICS
MQDLH Dead-letter header MQFMT_DEAD_LETTER_HEADER
MQDH Distribution-list header MQFMT_DIST_HEADER
MQEPH Embedded PCF header MQFMT_EMBEDDED_PCF
MQIIH IMS information header MQFMT_IMS
MQMDE Message-descriptor extension MQFMT_MD_EXTENSION
MQCFH PCF header MQFMT_ADMIN / MQFMT_EVENT / MQFMT_PCF
MQRMH Reference message header MQFMT_REF_MSG_HEADER
MQRFH Formatting header MQFMT_RF_HEADER
MQRFH2 Version-2 rules and formatting header MQFMT_RF_HEADER_2
MQWIH Work information header MQFMT_WORK_INFO_HEADER
MQXQH Transmission queue header MQFMT_XMIT_Q_HEADER

如果您想读取MQMD 字段,请参阅 here .

关于java - 获取 WebSphere MQ 消息头,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25868062/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com