Layer7 API Management

 View Only
  • 1.  API Gateway WMQ Integration

    Posted Aug 20, 2019 03:05 PM
    I have a use case of WMQ integration with API Gateway. In current setup we have IBM Datapower integrating with IBM Websphere MQ. In new setup, I want the same function to be performed by API Gateway. I am successfully able to PUT the message on WMQ, however the message PUT by API Gateway doesn't get processed by the listening APP, same message from Datapower gets processed by the listening APP. I can see both messages on the WMQ and also I see that they are picked for processing from the MQ by the listening APP.
    Can someone share whats wrong with the same xml message PUT by API Gateway but not getting processed?

    Below are the steps that I have performed to create API Gateway policy:
    1) Created a SOAP web service policy on API Gateway.
    2) Added the route via MQ assertion.

    3) It is an MQ put request with no reply. It puts an xml message on the MQ.

    4) Request is seen on the WMQ is as below when API Gateway puts the XML message:

    ****Message descriptor****

      StrucId  : 'MD  '  Version : 2

      Report   : 0  MsgType : 8

      Expiry   : -1  Feedback : 0

      Encoding : 273  CodedCharSetId : 819

      Format : '        '

      Priority : 0  Persistence : 0

      MsgId : X'414D5120524157494E54303120202020EACA5A5DB982CD21'

      CorrelId : X'000000000000000000000000000000000000000000000000'

      BackoutCount : 0

      ReplyToQ       : '                                                '

      ReplyToQMgr    : 'RAWINT01                                        '

      ** Identity Context

      UserIdentifier : 'mquser      '

      AccountingToken :

       X'0000000000000000000000000000000000000000000000000000000000000000'

      ApplIdentityData : '                                '

      ** Origin Context

      PutApplType    : '28'

      PutApplName    : 'jar                         '

      PutDate  : '20190819'    PutTime  : '21394807'

      ApplOriginData : '    '

      GroupId : X'000000000000000000000000000000000000000000000000'

      MsgSeqNumber   : '1'

      Offset         : '0'

      MsgFlags       : '0'

      OriginalLength : '-1' 

    ****   Message      ****
     ----------------------

    through an MQGET call

     message <<?xml version="1.0" encoding="UTF-8"?><ao:processBankEvents xmlns:ao=" http://ao.mytest.sample.com /" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><arg0><eventInfoList><eventData>This is test event</eventData><eventOutcome>SUCCESS</eventOutcome><eventSeqNbr>1</eventSeqNbr><eventSubType/><eventTimestamp>2019-03-28T08:15:30.504-0500</eventTimestamp><eventType>CD_APIG</eventType><eventUTC_UPTC/></eventInfoList><requestSourceId>TSTSRC</requestSourceId><requestUUID>TEST_CD_MATURITY_APIG</requestUUID></arg0></ao:processBankEvents>>

    no more messages

    Sample AMQSGET0 end

    5) Same message when put by Datapower looks below on WMQ:

    ****Message descriptor****

      StrucId  : 'MD  '  Version : 2

      Report   : 0  MsgType : 8

      Expiry   : -1  Feedback : 0

      Encoding : 546  CodedCharSetId : 819

      Format : 'MQSTR   '

      Priority : 0  Persistence : 0

      MsgId : X'414D5120524157494E54303120202020EACA5A5DBD7DCD21'

      CorrelId : X'000000000000000000000000000000000000000000000000'

      BackoutCount : 0

      ReplyToQ       : '                                                '

      ReplyToQMgr    : 'RAWINT01                                        '

      ** Identity Context

      UserIdentifier : 'mquser      '

      AccountingToken :

       X'0130000000000000000000000000000000000000000000000000000000000006'

      ApplIdentityData : '                                '

      ** Origin Context

      PutApplType    : '6'

      PutApplName    : 'WebSphere Datapower MQClient'

      PutDate  : '20190819'    PutTime  : '21374122'

      ApplOriginData : '    '

      GroupId : X'000000000000000000000000000000000000000000000000'

      MsgSeqNumber   : '1'

      Offset         : '0'

      MsgFlags       : '0'

      OriginalLength : '-1'

     

    ****   Message      **** 

     ----------------------

    through an MQGET call

     

    message <<?xml version="1.0" encoding="UTF-8"?>

     

    <ao:processBankEvents xmlns:ao="http://ao.mytest.sample.com/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">

    <arg0>

    <eventInfoList>

    <eventData>This is test event</eventData>

    <eventOutcome>SUCCESS</eventOutcome>

    <eventSeqNbr>1</eventSeqNbr>

    <eventSubType/>

    <eventTimestamp>2019-03-28T08:15:30.504-0500</eventTimestamp>

    <eventType>CD_DPWR</eventType>

    <eventUTC_UPTC/></eventInfoList>

    <requestSourceId>TSTSRC</requestSourceId>

    <requestUUID>TEST_CD_MATURITY_DPWR</requestUUID></arg0></ao:processBankEvents>>

    no more messages

    Sample AMQSGET0 end



    ------------------------------
    API Platform Product Architect
    DFS
    Chicago, IL
    ------------------------------


  • 2.  RE: API Gateway WMQ Integration

    Posted Aug 23, 2019 10:15 AM
    We have gone through the same process. Replacing our Datapower appliances with API Gateway and migrating the webservice proxies including the one with an internal MQ connection.

    Looking at your examples.
    I noticed that in the API Gateway example that the MQMD Format attribute is empty.
    I believe this should contain the value MQSTR (as in the Datapower example), so MQ knows the payload is a text string and will process and if necessary converts the message so the receiving app can interpret the message correctly.
     
    Hope this helps.


  • 3.  RE: API Gateway WMQ Integration
    Best Answer

    Posted Aug 23, 2019 10:17 AM

    Good morning. We have gone to the same process. We also replaced our Datapower applicances with API Gateway and migrated the webservice proxies (including the ones connected with MQ) to API Gateway.

    Looking at your example, I see that in the API GW example the MQMD (Message header) Format parameter is empty.

    I believe this has to be MQSTR (as in your Datapower example), so MQ understands that is processes a message string (text), and the message will be converted as appropriate, so the receiving app can understand and process the message as with Datapower....​




  • 4.  RE: API Gateway WMQ Integration

    Posted Sep 12, 2019 11:16 AM
    Hi Gerlof, thanks for the pointer. This did solve the issue for me.

    ------------------------------
    API Platform Product Architect
    DFS
    Chicago, IL
    ------------------------------



  • 5.  RE: API Gateway WMQ Integration

    Posted Sep 16, 2019 01:33 AM
    Hi together, 
    now I'm facing a similar Problem ;-) 
    I try to set the MQFormat property in the MQRFH2 Header to MQSTR but without success. 

    If I process a MQ message without the MQRFH2 Header, I am able to set the MQFormat property in the MQMD successfully to MQSTR. Then I add a MQRFH2 Header and put some additional folder and values in it. The MQRFH2 header is created successfully but the MQFormat property in the header is empty. 
    I use the same message like without the Header try. 
    I tried different configuration in the Route via MQ assertions. (e.g. copy properties to additional headers, pass through all properties, ...)  But nothing seems to be working. 
    Do you have any ideas? 
    regards
    Andreas


  • 6.  RE: API Gateway WMQ Integration

    Posted Aug 26, 2019 01:12 AM
    Hi,
    it seems that you're using different encodings for your message. The Gateways puts the message with Encoding 273 (EBCDIC) and the datapower is using a UNIX Code page (546).
    You can try to tell the gateway not to convert the message while putting on the Queue Manager, by setting the cluster wide property io.mqConvertMessageApplicationData to false.
    regards
    Andreas


  • 7.  RE: API Gateway WMQ Integration

    Posted Sep 12, 2019 11:21 AM
    Hi Andreas, thanks for the solution. I appreciate your help. The problem in my case was the MQSTR header missing. I tried your solution, it didn't actually gave me what I was looking for. Gerlof's answer did fix the issue for me. Thank you and everyone for pitching in. You guys rock.

    ------------------------------
    API Platform Product Architect
    DFS
    Chicago, IL
    ------------------------------