JavaCompute 노드를 사용하여 MQRFH2 헤더에 액세스

JavaCompute 노드에서 MQRFH2 헤더를 구성할 때 두 가지 유형의 필드가 있습니다.

다음 코드는 subscription 요청을 작성하기 위해 사용할 나가는 메시지에 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");

	MbXPath xp [equals char] new MbXPath("/MQMD/Format" + "[set-value(´MQHRF2´)]", root);
	root.evaluateXPath(xp);
}
변경 끝
관련 개념
메시지 플로우 개요
메시지 모델링
관련 태스크
메시지 플로우 설계
메시지 플로우 컨텐츠 정의
관련 참조
MQRFH2 헤더
주의사항 | 등록상표 | 다운로드 | 라이브러리 | 지원 | 피드백
Copyright IBM Corporation 1999, 2006 마지막 갱신 날짜: 2006/08/21
ac30440_