|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQPUT with Wait for 60 seconds and then an MQGET |
« View previous topic :: View next topic » |
Author |
Message
|
deepeshk79 |
Posted: Fri Sep 04, 2009 12:32 pm Post subject: MQPUT with Wait for 60 seconds and then an MQGET |
|
|
Apprentice
Joined: 25 Mar 2007 Posts: 45 Location: Los Angeles
|
Hi,
We are creating a CICS MQ Adapter that will read data from COMMAREA and then convert that to an MQ message and do an MQPUT on Queue1. Once MQPUT is done the program has to wait for 60 seconds and do an MQGET on Queue2 and check if there is any response. If yes then it has to transform the MQ message to COMMAREA and pass it back to client, if no then it has to populate a time out error in COMMAREA and then send it to client via EXEC CICS Link.
To summarize we have
CLIENT--cicslink--->CICS-MQ-ADAPTER PGM --mqput--60seconds--mqget---cicslink--CLIENT.
Im not sure how to do an MQPUT with wait for 60 seconds and then do an MQGET to check if we have received the message or not.
Any thoughts on this? Any better way to do this? If you have any sample code or link with details on MQPUT with wait and then an MQGET please reply.
Thanks,
Deepesh |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Sep 04, 2009 12:40 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You have it entirely backwards.
You want to do the MQPUT, and then tell the MQGET to wait no longer than 60 seconds.
The message will then arrive and be read by your transaction as soon as it is available, rather than at a minimum of 60 seconds later. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Sep 04, 2009 12:41 pm Post subject: Re: MQPUT with Wait for 60 seconds and then an MQGET |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
deepeshk79 wrote: |
Im not sure how to do an MQPUT with wait for 60 seconds and then do an MQGET to check if we have received the message or not. |
That's because you can't. It's the MQGET that has the wait.
deepeshk79 wrote: |
Any thoughts on this? Any better way to do this? |
Yes - stick with the conventional model. Do the PUT (and ensure it's committed - z/OS defaults to transational) and then do a GET with a 60 second wait. This has the advantage over just waiting for 60 seconds then doing a GET in that if the message returns after 20 seconds you don't waste 40 seconds.
Ensure you have a mechanism for dealing with replies that arrive in 61 or more seconds.
deepeshk79 wrote: |
If you have any sample code or link with details on MQPUT with wait and then an MQGET please reply. |
You won't find any code on put with wait because it doesn't wait. Most of the samples contain the code you actually want. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Sep 04, 2009 12:41 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Yes you need to revert your thinking.
You do an MQPUT (and make sure it is committed).
Then you make an MQGET with wait (60 seconds).
This will terminate immediately and give you the message as soon as a message is available....
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
bruce2359 |
Posted: Fri Sep 04, 2009 12:48 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9470 Location: US: west coast, almost. Otherwise, enroute.
|
This will terminate the WAIT immediately and give you the message as soon as a message is available.... _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Sep 05, 2009 7:42 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Thanks for the precision Bruce. This is what happens when you let your fingers get ahead of your brain...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|