DataPower

DataPower

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  ReplyToQmgr

    Posted Sun October 25, 2020 08:05 AM

    Dears,

    we are calling MQ service from datapower using mq url open.

    Our requirement is we will call one queue manager QM1 and put msg in queue1

    But our iib will reply to QM2 in queue2.

    How can we achieve this.

    we have tested that we can send msg to QM1 and read reply msg from queue1 , but how we can read reply from different queue manager and queue.

    Our below script for MQ call:

    var urlopen = require ('urlopen');

    var apim = require('apim');

    var Input = apim.getvariable('message.body');

    console.error(Input);

    //var name =json.name;

    var options =

    {

    target: 'dpmq://RB/?RequestQueue=requestQueue;ReplyQueue=replyQueue;timeout=6000',

    data : Input,

    headers : { MQMD : { // JSON object for specified header_name

    MQMD: { // JSON object for the MQMD header

    StructId : { $ : 'MD' } ,

    Version : { $ : '1'} ,

    }

    }

    }

    };

    urlopen.open (options, function(error, response) {

    if (error) {

    // an error occurred during the request sending or response header parsing

    //session.output.write("urlopen error: "+JSON.stringify(error));

    } else {

    // get the response status code

    var responseStatusCode = response.statusCode;

    console.log("Response status code: " + responseStatusCode);

    response.readAsBuffer(function(error, responseData){

    if (error){

    throw error ;

    } else {

    console.error(response.get({ type: 'mq'}, 'MQMD'));

    console.error(responseStatusCode);

    console.error(options);

    console.error(responseData);

    //apim.output('text/xml');

    session.output.write(responseData) ;

    }

    });

    }

    });

    ThankYou.



    #DataPower
    #Support
    #SupportMigration


  • 2.  RE: ReplyToQmgr

    Posted Mon October 26, 2020 12:38 PM

    Hi,

    your use case sounds interesting. Why does the IIB respond to different queue manager if you are processing things synchronously?

    --Hermanni



    #DataPower
    #Support
    #SupportMigration


  • 3.  RE: ReplyToQmgr

    Posted Mon October 26, 2020 06:29 PM

    Dear Hermann,

    Its is same architecture since earlier iib is not creating own local queue for response , because the are multiple consumers calling IIB mq service thats why iib is responding to the consumer's own queue not in local iib queue, and they wont change for datapower requirement, bcoz it will impact other services.


    is there any way to implement same.



    #DataPower
    #Support
    #SupportMigration


  • 4.  RE: ReplyToQmgr

    Posted Tue October 27, 2020 09:17 AM

    Hi,

    you could try to create a remote queue for DataPower reply

    https://www.ibm.com/support/knowledgecenter/SSFKSJ_9.0.0/com.ibm.mq.adm.doc/q021210_.htm



    #DataPower
    #Support
    #SupportMigration


  • 5.  RE: ReplyToQmgr

    Posted Tue October 27, 2020 02:14 PM

    I think that you cannot change queue manager ""on-the-fly". When you use request-response pattern DataPower opens TCP/IP connection to the queue manager that you are sending the request and then it waits for a reply. The connection cannot be switched to other QM in the same transaction.


    As Yuri suggested defining a remote queue on QM2 pointing to QM1 would be the easiest solution. You mentioned that IIB is responding to the consumer's own queue and there are multiple consumers. So there are multiple response queues already and some kind of dynamic routing on IIB flow?


    --Hermanni



    #DataPower
    #Support
    #SupportMigration


  • 6.  RE: ReplyToQmgr

    Posted Tue October 27, 2020 09:10 PM

    Yes Hermann , there are multiple queues based on consumer.

    ok will try with remote queue as suggested.



    #DataPower
    #Support
    #SupportMigration