Author |
Message
|
rajesh_avrs |
Posted: Thu Jul 29, 2004 11:01 pm Post subject: Force message to a specific queue manager in cluster |
|
|
Apprentice
Joined: 18 May 2001 Posts: 31
|
Hi,
I have two 2000 servers hosting Queue managers QM1 and QM2. I have an OS/390 box hosting another queue manager, QM3. All the three queue managers are part of a cluster.
QM1 and QM2 are hosting a queue called RESPONSE. QM3 is hosting a queue called ASKME and is shared in cluster too.
Now I have some clients who either connect to QM1 or QM2. They post a request message to ASKME and wait for response on RESPONSE queue on the same queue manager. Some program in QM3 is reading the messages posted in ASKME and put a response in RESPONSE.
The OS/390 program is using MQPUT1 to put a response into the RESPONSE queue. Now because of the default cluster load balancing, the response can go to either QM1 RESPONSE queue or QM2 RESPONSE queue. In this setup, only 50% of the times, the client would get a response back.
We thought we will over come the problem by setting the "Object Queue Manager" field in the MQObject Descripter to the reply to queue manager specified in the request message.
To my surprise, even after setting the MQOD Object Queue Manager, the response message is still not forced to go to the queue manager where the request was originated... I am using all the default BIND options... and using all the default parameters applicable to clustering...
Is there any place I need to look for this problem? I need the RESPONSE back to the same queue manager queue where the client is connected.... and the clients have a choice of connecting to whatever the queue manager they like, either QM1 or QM2....
Any responses will be highly appreciated...
Thanks,
Rajesh _________________ ****************
MQSeries is cool
**************** |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jul 30, 2004 5:27 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Have you tried with a dynamic response queue created by the application doing the put?
The ideal would be for the application to declare the dynamic queue once,
use it as long as needed. Just make sure it gets removed / deleted when the application shuts down / switches qmgr
Hope this helps some. |
|
Back to top |
|
 |
rajeshavrs |
Posted: Fri Jul 30, 2004 8:21 am Post subject: |
|
|
 Novice
Joined: 15 Jun 2004 Posts: 10
|
That's a great idea, which I would surely implement in my next assignment...
Unfortunately, the setup I mentioned is already in place in Production and we are looking for a fix at a configuration level, if any....
Any more ideas? |
|
Back to top |
|
 |
PeterPotkay |
Posted: Fri Jul 30, 2004 1:42 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Quote: |
We thought we will over come the problem by setting the "Object Queue Manager" field in the MQObject Descripter to the reply to queue manager specified in the request message.
|
This is the one and only way of doing it. If its not working, either there is a bug in the IBM MQ code (doubt it, since we do what you are trying to do all the time) or your code is not coded the way you think it is. (Post the code?)
The only other possability is that you have QMAliases for QM1 and QM2 on QM3 that blank out the Destination QM of the reply message, causing round robining to kick in despite what the program put out. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
rajeshavrs |
Posted: Fri Jul 30, 2004 1:52 pm Post subject: |
|
|
 Novice
Joined: 15 Jun 2004 Posts: 10
|
Where can I get the sample COBOL code that actually rips off the "Reply To Queue" from request message and sets it in the "MQOD Object Queue Manager name"?
Thank you. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Fri Jul 30, 2004 2:01 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Do your MQGET
Code: |
MOVE MQMD-REPLYTOQMGR TO W01-HOLD-THE-NAME
|
.
.
Work on the request
.
.
Get ready for the MQPUT1
Code: |
MOVEW01-HOLD-THE-NAME TO MQOD-OBJECTQMGRNAME
|
Do the MQPUT1
??? _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
rajeshavrs |
Posted: Fri Jul 30, 2004 2:45 pm Post subject: |
|
|
 Novice
Joined: 15 Jun 2004 Posts: 10
|
I might be being paranoid... but, does the above piece of code always works as intended, irrespective of the cluster bind options?
I mean, whether bind option is "Bind on Open" or "Not Fixed"... will the above piece of code always instructs MQ to route the message to the queue manager specified in MQOD Object Queue Manager?
1) What happens if I specify QM4 (some junk value) in this field?
2) What happens if I specify QM1 and before the MQPUT1 happens QM1 goes down?
Any special scenarios I need to consider for my testing? |
|
Back to top |
|
 |
PeterPotkay |
Posted: Fri Jul 30, 2004 4:34 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Quote: |
does the above piece of code always works as intended, irrespective of the cluster bind options?
|
Yes. Doesn't matter in your case anyway, since you are using the MQPUT1 call. See this quote from the manual:
Code: |
The MQPUT1 call always operates as though MQOO_BIND_NOT_FIXED were in effect, that is, it always invokes the workload management routine.
|
Quote: |
1) What happens if I specify QM4 (some junk value) in this field?
|
DLQ or your MQPUT call fails, can't remember exactly which one. I think the MQPUT will fail.
Quote: |
2) What happens if I specify QM1 and before the MQPUT1 happens QM1 goes down?
|
The message will wait in the S.C.T.Q until it comes back up.
Quote: |
Any special scenarios I need to consider for my testing?
|
I think you have covered all of them in this regard. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
luckykao |
Posted: Sun Sep 12, 2004 5:58 pm Post subject: |
|
|
Newbie
Joined: 12 Sep 2004 Posts: 1
|
Where can I get the sample Java code?
It seems to be no mqod in Java Architecture.
Like mqmd destributes into the message parameters?
And if i force the message to a specific queue manager in a cluster
, then QM1 or QM2 fail, will the message be sent to the other one for
high availability?
Thanks for your responses! |
|
Back to top |
|
 |
PeterPotkay |
Posted: Mon Sep 13, 2004 5:03 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Quote: |
Where can I get the sample Java code?
It seems to be no mqod in Java Architecture.
Like mqmd destributes into the message parameters?
|
Read the MQ Jave Manual (Documentation Button at the top of this screen)
Quote: |
And if i force the message to a specific queue manager in a cluster
, then QM1 or QM2 fail, will the message be sent to the other one for
high availability?
|
No. If you said to go to QM1, it will only go to QM1, or will keep trying till QM1 is available. The behaviour you want can only be accomplished by a custom Cluster Workload exit that you write yourself.
Also, read this post:
http://www.mqseries.net/phpBB2/viewtopic.php?t=17012&highlight=exit _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
|