Author |
Message
|
Sam Uppu |
Posted: Wed Apr 27, 2011 9:32 am Post subject: MQGET node issue |
|
|
 Yatiri
Joined: 11 Nov 2008 Posts: 610
|
Hi guys,
I need clarification reagrding MQGET node. Message broker OS is Windows XP and version is
BIP8996I: Version: 6103
BIP8997I: Product: WebSphere Message Brokers
BIP8998I: CMVC Level: S610-FP03 DH610-L81015
BIP8999I: Build Type: Production
My message flow is as below.
MQINPUT ------> Compute Node ---> MQGET ---> Compute Node 2----> MQOUTPUT
When we get any response to our MQinput node , we are checking if the correlation ID matches with that on MQGET queue. If Yes we are proceeding further. Else we are throwing exception.
We are using GET by Correlation ID option checked on the MQGET node.
The message in MQGET node has a non zero correlation ID.
Now, a response comes on MQinput node with correlation ID as zeros. As the correlation ID doesn't match, the message should go to no message terminal.
But in my case, I am getting message to 'OUT' terminal of MQGET node.
When I use SET OutputLocalEnvironment.MQ.GET.MQGMO.MatchOptions = MQMO_MATCH_CORREL_ID; the message comes out of 'no message' terminal.
Do I need to set the localenvironment option ? Does the 'Get By corelation ID" option on MQGET node doesn't work?
Not sure if anyone has faced this issue.
Can you guys throw some light on this. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Apr 27, 2011 10:18 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Have you tried in the compute node to set the expected correlationID on the MQMD before you enter the MQGET node?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Sam Uppu |
Posted: Wed Apr 27, 2011 10:39 am Post subject: |
|
|
 Yatiri
Joined: 11 Nov 2008 Posts: 610
|
fjb_saper wrote: |
Have you tried in the compute node to set the expected correlationID on the MQMD before you enter the MQGET node?  |
fjb,
"Get by Correlation ID" option on MQGET node works fine if the response message has a non-zero correlation ID . I have issue only if the response message is received with zero correlation ID and the message on MQGET node queue has non-zero correlation ID.
The response message which I receive on MQinput node has MQMD with correlation ID as zeros.
By default the MQGETnode uses InputRoot.MQMD for MQGET. SO, I think I need to explicitly set the correlation ID.
Thanks |
|
Back to top |
|
 |
Vitor |
Posted: Wed Apr 27, 2011 10:44 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Sam Uppu wrote: |
By default the MQGETnode uses InputRoot.MQMD for MQGET. SO, I think I need to explicitly set the correlation ID. |
I think you do to.
Consider the perhaps more common situation where, rather than attempting to correlate the original input message as here, you send an request mid-flow with an MQOutput node & need to identify the response to that. In this situation you'd need the id from your generated request message rather than the original input id, and thus need to set it within the code. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Sam Uppu |
Posted: Wed Apr 27, 2011 10:53 am Post subject: |
|
|
 Yatiri
Joined: 11 Nov 2008 Posts: 610
|
Vitor wrote: |
Sam Uppu wrote: |
By default the MQGETnode uses InputRoot.MQMD for MQGET. SO, I think I need to explicitly set the correlation ID. |
I think you do to.
Consider the perhaps more common situation where, rather than attempting to correlate the original input message as here, you send an request mid-flow with an MQOutput node & need to identify the response to that. In this situation you'd need the id from your generated request message rather than the original input id, and thus need to set it within the code. |
We drop the request message to a state queue to match the response by correlation ID.
Before dropping the request message we copy the message ID to correlation ID and drop the message.
When we receive the response, it has correlation ID same as the request. So I didn't had any problem when getting the message by correlation from the MQGET queue.
But when I receive a response with zero correlation ID, still I am getting message from MQGET queue though the correlation ID's do not match.
I didn't understand why do we need to set the correlation ID explictly? |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Apr 27, 2011 10:53 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Sam Uppu wrote: |
fjb_saper wrote: |
Have you tried in the compute node to set the expected correlationID on the MQMD before you enter the MQGET node?  |
fjb,
"Get by Correlation ID" option on MQGET node works fine if the response message has a non-zero correlation ID . I have issue only if the response message is received with zero correlation ID and the message on MQGET node queue has non-zero correlation ID.
The response message which I receive on MQinput node has MQMD with correlation ID as zeros.
By default the MQGETnode uses InputRoot.MQMD for MQGET. SO, I think I need to explicitly set the correlation ID.
Thanks |
Setting the correlationID to hex zeros when doing a get by correlationID will indicate that in essence you will accept any message (See MQCI_NONE).
You may need to explicitly ask for the MQOutput node to create you a correlationID.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Sam Uppu |
Posted: Wed Apr 27, 2011 11:13 am Post subject: |
|
|
 Yatiri
Joined: 11 Nov 2008 Posts: 610
|
fjb_saper wrote: |
Sam Uppu wrote: |
fjb_saper wrote: |
Have you tried in the compute node to set the expected correlationID on the MQMD before you enter the MQGET node?  |
fjb,
"Get by Correlation ID" option on MQGET node works fine if the response message has a non-zero correlation ID . I have issue only if the response message is received with zero correlation ID and the message on MQGET node queue has non-zero correlation ID.
The response message which I receive on MQinput node has MQMD with correlation ID as zeros.
By default the MQGETnode uses InputRoot.MQMD for MQGET. SO, I think I need to explicitly set the correlation ID.
Thanks |
Setting the correlationID to hex zeros when doing a get by correlationID will indicate that in essence you will accept any message (See MQCI_NONE).
You may need to explicitly ask for the MQOutput node to create you a correlationID.  |
But if I set
SET OutputLocalEnvironment.MQ.GET.MQGMO.MatchOptions = MQMO_MATCH_CORREL_ID;
and passing response with zero correlation ID, I am getting 2033, 'no message' terminal.
What is the difference between setting local environment matchoptions and setting GET by correlation ID match on MQGET node.
Is Matchoption not same as "GET by correlation ID" option on MQGET node |
|
Back to top |
|
 |
Vitor |
Posted: Wed Apr 27, 2011 11:20 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Sam Uppu wrote: |
Is Matchoption not same as "GET by correlation ID" option on MQGET node |
It's exactly the same (provided you've configured the Compute node to send it; if not then one works and one doesn't!)
If the correlation id to be matched is hex zeros, it will match the first message that meets all the other criteria (committed, priority, etc, etc). If it's doing anything else it's broken. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Sam Uppu |
Posted: Wed Apr 27, 2011 1:36 pm Post subject: |
|
|
 Yatiri
Joined: 11 Nov 2008 Posts: 610
|
Vitor wrote: |
It's exactly the same (provided you've configured the Compute node to send it; if not then one works and one doesn't!) |
Do you mean configure correlation ID in compute node ? or setting the local environment variable(MQGMO.MatchOptions)? |
|
Back to top |
|
 |
Vitor |
Posted: Wed Apr 27, 2011 2:18 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Sam Uppu wrote: |
Vitor wrote: |
It's exactly the same (provided you've configured the Compute node to send it; if not then one works and one doesn't!) |
Do you mean configure correlation ID in compute node ? or setting the local environment variable(MQGMO.MatchOptions)? |
I mean that the local environment variable is exactly the same as the equivalent option on the MQGet node provided that it's passed to the MQGet node by the Compute node (which is not the default case). _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Sam Uppu |
Posted: Wed Apr 27, 2011 3:45 pm Post subject: |
|
|
 Yatiri
Joined: 11 Nov 2008 Posts: 610
|
Thank you Vitor.
As you said,
Quote: |
If the correlation id to be matched is hex zeros, it will match the first message that meets all the other criteria (committed, priority, etc, etc). |
According to the above statement, if the response comes with hex zeros correlation ID, then a random request is retrieved from the MQGET queue.
which is not correct .Can you guys guide me what should we do for cases where we get zero correlation ID? |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Apr 27, 2011 7:33 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Sam Uppu wrote: |
Thank you Vitor.
As you said,
Quote: |
If the correlation id to be matched is hex zeros, it will match the first message that meets all the other criteria (committed, priority, etc, etc). |
According to the above statement, if the response comes with hex zeros correlation ID, then a random request is retrieved from the MQGET queue.
which is not correct .Can you guys guide me what should we do for cases where we get zero correlation ID? |
Like I said you should never look for a zero (MQCI_NONE) correlationID. If you do you already missed something. Like making sure the previous MQOutput node sets a correlationId....  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Vitor |
Posted: Thu Apr 28, 2011 4:09 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Sam Uppu wrote: |
Can you guys guide me what should we do for cases where we get zero correlation ID? |
Push back on whoever's sending the requests to always supply a valid correlation id?
Seriously, the correlation id is intended to allow the consuming application to correlate that message with something. In the scenario you're describing, it's a response that must be correlated with a request. If the id is zeros how, from a logicial design standpoint, can that message be considered a response to any given message? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Gerd-in-ZA |
Posted: Thu Apr 28, 2011 8:53 am Post subject: Question is mostly answered already; just two comments: |
|
|
Novice
Joined: 13 Sep 2006 Posts: 14 Location: Johannesburg, South Africa
|
One comment: You can read up about an all zero Correl-ID in the MQ info center. Then it is easier to understand why the behaviour is as it is. (All binary zeros = "no Correl-ID")
The really interesting question, though, is "what shall we do for cases where we get zero correlation ID?"
And this is where we can only ask back: From a business perspective, what does a zero correlation ID signify? Is there another message - and only one - with a zero correlation ID that we need to match this one with? Or is it some sort of a "don't know" value? What do you need to do, matching-wise, when this happens? Are there, maybe, default values that you could set? Clearly, the MQGET "by Correl-ID", as you currently do it, doesn't do the trick. If nothing else, the message consumed by the "mis-match" will be missing somewhere at a later stage.
So the least I would expect is that you test the incoming correl-ID for an all-zero value and then don't do the MQGET - what else you must do. I can't say. That's a business decision.
Good luck! _________________ -- Gerd -- |
|
Back to top |
|
 |
|