Mule ESB - WMQ 连接器 - 如何访问 WMQ 消息 Header 值

Mule ESB - WMQ Connector - how to access WMQ message Header values

我们正在使用 Java8,带有 WMQ 连接器的 Mule ESB 3.7.2。

这是 Pub/Sub 应用程序,我已经创建了具有唯一应用程序标识数据的订阅者。这在 IBM WMQ 中可用 MQMD.ApplIdentityData。

但是,Mule 消息不会带来这个header 信息。有没有办法在 Mule 流中访问这个值?

应用程序设计是这样的...

Mule - WMQ 连接器:

<wmq:xa-connector name="WMQ" hostName="localhost" port="1414" queueManager="MyTestQM" transportType="CLIENT_MQ_TCPIP" validateConnections="true" doc:name="WMQ"   numberOfConsumers="10" cacheJmsSessions="true"/>

<wmq:inbound-endpoint queue="PUBLISH_QUEUE" connector-ref="WMQ" doc:name="WMQ"/>

骡子留言:

INFO  2016-03-16 16:44:10,941 [[pubsub].pubsubFlow1.stage1.02] org.mule.api.processor.LoggerMessageProcessor: Consumer - 

org.mule.DefaultMuleMessage
{
  id=4f16e372-eb96-11e5-8945-ecb020524153
  payload=[B
  correlationId=ID:414d51204d7954657374514d202020206a5be95620018c3f
  correlationGroup=-1
  correlationSeq=-1
  encoding=UTF-8
  exceptionPayload=<not set>

  Message properties:
  INVOCATION scoped properties:
  INBOUND scoped properties:
        JMSCorrelationID=ID:414d51204d7954657374514d202020206a5be95620018c3f
        JMSDeliveryMode=1
        JMSDestination=topic://EIS_Test_Topic
        JMSExpiration=0
        JMSMessageID=ID:414d51204d7954657374514d202020206a5be9562001ea03
        JMSPriority=0
        JMSRedelivered=false
        JMSTimestamp=1458146650880
        JMSXAppID=MyTestQM                                                            
        JMSXDeliveryCount=1
        JMSXUserID=Santhosh-Kum
        JMS_IBM_Character_Set=ISO-8859-1
        JMS_IBM_Encoding=273
        JMS_IBM_Format=                        
        JMS_IBM_MsgType=8
        JMS_IBM_PutApplType=26
        JMS_IBM_PutDate=20160316
        JMS_IBM_PutTime=16441088
        MULE_CORRELATION_ID=ID:414d51204d7954657374514d202020206a5be95620018c3f
        MULE_MESSAGE_ID=ID:414d51204d7954657374514d202020206a5be9562001ea03
        MULE_ORIGINATING_ENDPOINT=endpoint.wmq.PUBLISH.QUEUE
  OUTBOUND scoped properties:
  SESSION scoped properties:
  }

您应该能够访问任何 MQMD 字段,假装它是 属性。所以你可以要求 属性 Root.MQMD.ApplIdentityData.

Mule ESB 将截断 header 来自 MQ 消息的值,在 post 将其发送到流之前。

Mulesoft 正在增强连接器。

在那之前,唯一可用的选项是 Java Listener with Polling。如果我听到其他消息,我会 post。