ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » Mainframe, CICS, TXSeries » MQPUT with Wait for 60 seconds and then an MQGET

Post new topic  Reply to topic
 MQPUT with Wait for 60 seconds and then an MQGET « View previous topic :: View next topic » 
Author Message
deepeshk79
PostPosted: Fri Sep 04, 2009 12:32 pm    Post subject: MQPUT with Wait for 60 seconds and then an MQGET Reply with quote

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
View user's profile Send private message AIM Address
mqjeff
PostPosted: Fri Sep 04, 2009 12:40 pm    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Fri Sep 04, 2009 12:41 pm    Post subject: Re: MQPUT with Wait for 60 seconds and then an MQGET Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Fri Sep 04, 2009 12:41 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
bruce2359
PostPosted: Fri Sep 04, 2009 12:48 pm    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Sat Sep 05, 2009 7:42 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » Mainframe, CICS, TXSeries » MQPUT with Wait for 60 seconds and then an MQGET
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.