使用 JavaCompute 节点访问 MQRFH2 头

当您在 JavaCompute 节点中构造 MQRFH2 头时,有两类字段;

以下代码将 MQRFH2 头添加到用于作出预订请求的外发消息中:
public void addRfh2(MbMessage msg) throws MbException
{
MbElement root = msg.getRootElement();
MbElement body = root.getLastChild();
// insert new header before the message body
MbElement rfh2 = body.createElementBefore("MQHRF2");
rfh2.createElementAsFirstChild(MbElement.TYPE_NAME_VALUE, "Version", new Integer(2));
rfh2.createElementAsFirstChild(MbElement.TYPE_NAME_VALUE, "Format", "MQSTR");
rfh2.createElementAsFirstChild(MbElement.TYPE_NAME_VALUE, "NameValueCCSID", new Integer(1208));
MbElement psc = rfh2.createElementAsFirstChild(MbElement.TYPE_NAME, "psc", null);
psc.createElementAsFirstChild(MbElement.TYPE_NAME, "Command", "RegSub");
psc.createElementAsFirstChild(MbElement.TYPE_NAME, "Topic", "department");
psc.createElementAsFirstChild(MbElement.TYPE_NAME, "QMgrName", "QM1");
psc.createElementAsFirstChild(MbElement.TYPE_NAME, "QName", "PUBOUT");
psc.createElementAsFirstChild(MbElement.TYPE_NAME, "RegOpt", "PersAsPub");
}
相关概念
消息流概述
消息建模
相关任务
设计消息流
定义消息流内容
相关参考
MQRFH2 头
声明 | 商标 | 下载 | | 支持 | 反馈
Copyright IBM Corporation 1999, 2006 最后更新:2006/05/19
ac30440_