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