Skip to main content

developerWorks >  SOA and Web services  >  Forums  >  IBM WebSphere DataPower SOA Appliance  >  developerWorks

MQ Get based on a matching Correlation Id    Point your RSS reader here for a feed of the latest messages in this thread


     

 
 

My developerWorks
 Welcome, Guest
Sign in or register
Permlink Replies: 2 - Pages: 1 - Last Post: Nov 6, 2009 7:52 AM Last Post By: ashoon Threads: [ Previous | Next ]
Sinu Sekhar

Posts: 54
Registered: Dec 03, 2004 05:07:51 PM
MQ Get based on a matching Correlation Id
Posted: Aug 05, 2009 02:28:39 PM
Click to report abuse...   Click to reply to this thread Reply
Hello All,

I am working on a use case where the PUT and Get and separate web service calls.
During the Put, I am responding back with the Message ID that will be used for correlation during a GET Call.
I use a stylesheet to parse the Message ID out of the response headers to return it to the Caller.

Now during get, I need to specify the Correlation ID for match and here is what I am doing.
I am setting the DP variable var://context/INPUT/_extension/header/X-MQMD-Get
to
<MQMD><CorrelId>414d512044502e514d475220202020204a7752f620027903</CorrelId></MQMD>
and my MQ URL looks like this
dpmq://QMObject/?ReplyQueue=ResponseQ;MatchOptions=2

MatchOptions=2 because the value of GMO option for matching correlation ID is 2.

I am not getting a message which matches the correlation id, but just any message from the Q.

Am I missing something here?
I also tried setting the MQMD header shown above to the header using set-request-header and set-response-header, but that didnt work either.

I see a lot of documentation on controlling the ReplyQ but none on how to set GET Options and a comprehensive list of options with their Values that can be specified. I have went through the DataPower book on Integrating with MQ and it talks about the variables I used above to control the Get Options. Please let me know if I am missing any step here.

I did see an example in the DataPower book to loop through messages and look for a message using Browse option, but i really dont want to do that in DataPower and the Q's could have thousands of mesages and it could become a really expensive operation.

Regards,
Sinu
Charlie Price

Posts: 1
Registered: Nov 04, 2009 02:14:55 PM
Re: MQ Get based on a matching Correlation Id
Posted: Nov 04, 2009 02:16:51 PM   in response to: Sinu Sekhar in response to: Sinu Sekhar's post
Click to report abuse...   Click to reply to this thread Reply
Have you made any progress on this? I have the same problem, have tried many different
options without success. I'm opening a problem this afternoon on the DataPower queue.

Charlie
ashoon

Posts: 62
Registered: Dec 13, 2007 02:28:29 PM
Re: MQ Get based on a matching Correlation Id
Posted: Nov 06, 2009 07:52:03 AM   in response to: Sinu Sekhar in response to: Sinu Sekhar's post
Click to report abuse...   Click to reply to this thread Reply
here's an xsl that maybe helpful.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dp="http://www.datapower.com/extensions"
xmlns:dpconfig="http://www.datapower.com/param/config" xmlns:date="http://exslt.org/dates-and-times"
extension-element-prefixes="dp dpconfig date"
version="1.0">

<xsl:template match="/">

<xsl:variable name="msgId" select="/mqMsgId"/>

<xsl:variable name="mqmd">
<MQMD>
<MsgId><xsl:value-of select="$msgId"/></MsgId>
</MQMD>
</xsl:variable>
<xsl:variable name="headers">
<header name="X-MQMD-GET">
<dp:serialize select="$mqmd" omit-xml-decl="yes"/>
</header>
</xsl:variable>

<dp:url-open http-headers="$headers" target="dpmq://devQueueManager/?ReplyQueue=MQSTORETEST" response="xml"/>

</xsl:template>
</xsl:stylesheet>

Point your RSS reader here for a feed of the latest messages in all forums