Layer7 API Management

 View Only
  • 1.  How to read MQ MsgID and CorrelId within Policy

    Posted Jul 15, 2020 06:56 AM
    Hi together, 

    I have the following scenario.
    MQ (Inbound) --> HTTP (Outbound)
    I receive a message from a Native MQ Queue within a Policy. 
    Within this policy I want to read the MQMD.MsgId and MQMD.CorrelId field from the MQ message. 
    I was able to get the value of the MQMD.expiry field like described in the documentation within the ServiceDebugger, with request.mqnative.md.expiry. (https://techdocs.broadcom.com/content/broadcom/techdocs/us/en/ca-enterprise-software/layer7-api-management/api-gateway/9-4/policy-assertions/assertion-palette/message-routing-assertions/route-via-mq-native-assertion.html)

    But I was not able to read the values for the MsgId and CorrelId. 
    I tried several combinations in the service debugger to get the values. 
    request.mqnative.md.msgid
    request.mqnative.md.MsgId
    request.mqnative.md.msgId
    request.mqnative.md.msgID
    request.mqnative.md.MsgID
    request.mqnative.md.MSGID
     
    request.mqnative.md.correlid
    request.mqnative.md.CorrelId
    request.mqnative.md.correlId
    request.mqnative.md.CorrelID

    all without success. The received value was every "null"

    In addition, I want to set the MQMD.CorrelId while I put a message to the queue. The scenario is HTTP --> MQ 
    So, I created an OUTBOUND Q and in the policy I added a Route via MQNative Assertion. Within this assertion, in the Request Tab I enabled "Pass through all message descriptors" and added the Name: CorrelId Value: 000000000000000000000000000000000000000000000010, in the list. 
    I received the error: "Ignoring invalid message descriptor filed: CorrelId"

    So was anyone able to read and set the mentioned MQMD fields. 

    regards
    Andreas


  • 2.  RE: How to read MQ MsgID and CorrelId within Policy

    Broadcom Employee
    Posted Jul 15, 2020 05:16 PM
    I am no expert with Native MQ, but have you tried recording ${request..mqnative.additionalheadernames}, ${request.mqnative.propertynames} to confirm that what you are looking for is being picked up? That is where I would begin to trouble shoot this.

    ------------------------------
    Jay MacDonald - Adoption Architect - Broadcom API Management (Layer 7)
    ------------------------------



  • 3.  RE: How to read MQ MsgID and CorrelId within Policy
    Best Answer

    Posted Jul 16, 2020 03:59 AM
    Hi Jay, 

    the additional properties and additionalheaders are custom headers which you can use to extend the MQ message. 
    My goal was to get information from MQMD.
    After several ours of searching, I figured it out. 
    The Gateway MQ implementation based on JMS, so I had to use the JMS MQ fields messageId and correlationId.
    For example: request.mqnative.md.messageId and request.mqnative.md.correlationId. 

    regards
    Andreas