我确实有Java代码客户端监听器来监听MQ-Queue。在我们收到消息之前,我们启用Header Read Enable标志来获取标头值。
代码是这样的......
dest.setBooleanProperty(WMQConstants.WMQ_MQMD_READ_ENABLED, true);
MQQueueManager qMgr = new MQQueueManager(qManager);
MQQueue queue = qMgr.accessQueue(qName);
// Can this be enabled in IBM MQ Creation level ????????????????????????
queue.setBooleanProperty(WMQConstants.WMQ_MQMD_READ_ENABLED, true);
MQMessage rcvMessage = new MQMessage();
queue.get(rcvMessage, gmo);
System.out.println("Sample Header Value : " + rcvMessage.applicationIdData);
// Code to read Message Content...
可以在IBM MQ创建级别启用 WMQConstants.WMQ_MQMD_READ_ENABLED ?????