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 » General IBM MQ Support » How to End a Get w/wait before the wait interval?

Post new topic  Reply to topic
 How to End a Get w/wait before the wait interval? « View previous topic :: View next topic » 
Author Message
gpklos
PostPosted: Tue Aug 05, 2008 5:54 am    Post subject: How to End a Get w/wait before the wait interval? Reply with quote

Centurion

Joined: 24 May 2002
Posts: 108

I have a coder that is running a program as a windows service. In his program he has one thread which is doing a GET w/wait for 60 seconds. Now if the Windows Service is stopped (they are doing this via a batch file), he has a second thread which catches the request to stop the program. At this point he wants to close the queue that has the GET w/wait happening on it. He tries to do it with the second thread but the GET w/wait won't let him close the queue. So basically he has to wait for the entire minute before the service stops. Is there some way he can force the GET w/Wait to end prematurely from the second thread, so that the he can disconnect and end the service instead of waiting for the get to end?

Thank you very much,
Gary
Back to top
View user's profile Send private message
David.Partridge
PostPosted: Tue Aug 05, 2008 6:01 am    Post subject: Reply with quote

Master

Joined: 28 Jun 2001
Posts: 249

Yes, change the code so that it does the get/wait with MQGMO_FAIL_IF_QUIESCING. When you go to close the QM the get will fail with reason MQRC_Q_MGR_QUIESCING.
_________________
Cheers,
David C. Partridge
Back to top
View user's profile Send private message
David.Partridge
PostPosted: Tue Aug 05, 2008 6:02 am    Post subject: Reply with quote

Master

Joined: 28 Jun 2001
Posts: 249

Ooops - this wasn't QM shutddown scenario.

So, change the code so you use a shorter wait interval of (e.g.) five seconds). This is still an eternity in computer time.
_________________
Cheers,
David C. Partridge
Back to top
View user's profile Send private message
Michael Dag
PostPosted: Tue Aug 05, 2008 6:14 am    Post subject: Reply with quote

Jedi Knight

Joined: 13 Jun 2002
Posts: 2607
Location: The Netherlands (Amsterdam)

use the second thread to put a "STOP" message on the Queue
_________________
Michael



MQSystems Facebook page
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
gpklos
PostPosted: Tue Aug 05, 2008 6:34 am    Post subject: Reply with quote

Centurion

Joined: 24 May 2002
Posts: 108

I did suggest to the applications before I posted to have the 2nd thread put a "stop" message to the queue. Unless there is another way, that is more than likely the way the application will go. We want them to have a wait interval that is high enough because they are polling, not triggering. Originally they had it set up to poll every 1 second with no wait. Obviously this is a resource problem, so I told them to figure an "ideal" wait time and that is when they ran into this problem.

Thanks for the suggestions,
Gary
Back to top
View user's profile Send private message
bruce2359
PostPosted: Tue Aug 05, 2008 6:46 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

If memory serves... setting the queue get-inhibited will terminate the get-wait.
_________________
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
gpklos
PostPosted: Tue Aug 05, 2008 7:02 am    Post subject: Reply with quote

Centurion

Joined: 24 May 2002
Posts: 108

Now that I didn't think of. Probably because we don't let our application programmers have access to change the queue attributes. However that at least gives me the option to provide a program for them that would do that, if they don't want to put a "STOP" message on the queue.
Thanks,
Gary
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Aug 05, 2008 7:30 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

There is an MQMD.Feedback field specifically for "STOP" messages.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Tue Aug 05, 2008 7:36 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

Quote:
There is an MQMD.Feedback field specifically for "STOP" messages.

But applications must be coded to understand it and take appropriate action (inaction). There is also an equivalent fb for ack and nack.
_________________
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
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » How to End a Get w/wait before the wait interval?
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.