Author |
Message
|
rgarcia |
Posted: Fri Oct 31, 2003 5:57 am Post subject: How to disconnect a GET wait unlimited queue? |
|
|
Newbie
Joined: 12 Nov 2002 Posts: 5
|
I need to end a java application wich have a queue blocked on a GET call (wait unlimited). I know I can put a dumb quit message into the queue and process it to finish the thread, but I would like to know if there's some other way to do it...
Thanks. |
|
Back to top |
|
 |
bower5932 |
Posted: Fri Oct 31, 2003 7:23 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
You can either send the quit message or change the get to have a wait limit and check something else. I think this scenario is one of the reasons that people are discourage from using the wait unlimited. |
|
Back to top |
|
 |
dgolding |
Posted: Fri Oct 31, 2003 7:26 am Post subject: |
|
|
 Yatiri
Joined: 16 May 2001 Posts: 668 Location: Switzerland
|
AFAIK the only way you get out of a WAIT_UNLIMITED is:
1) Get a message (obviously)
2) Specify MQGMO_FAIL_IF_QUIESCING in the GetMessageOptions, and shut down the queue manager - that's a bit drastic.
If it's Unix you can think about a signal handler to trap a kill -1, then exit. I'm not too sure if you can do that in Java.
How about receiving a message with a high priority (i.e. not zero) - and this is a control message to shutdown?
HTH |
|
Back to top |
|
 |
bob_buxton |
Posted: Sat Nov 01, 2003 4:25 am Post subject: |
|
|
 Master
Joined: 23 Aug 2001 Posts: 266 Location: England
|
You could Get-Disable the queue _________________ Bob Buxton
Ex-Websphere MQ Development |
|
Back to top |
|
 |
rgarcia |
Posted: Tue Nov 04, 2003 3:40 am Post subject: |
|
|
Newbie
Joined: 12 Nov 2002 Posts: 5
|
Thanks for your answers, but:
1.- I can't put a dumb message in the queue because there is more than one application that is using that queue, and I'm not sure which of them will get the message.
2.- I tried to Get-Disable the queue from another thread but I can't if it's locked in a get call. In fact, I think that is the QueueManager object that obtained the queue who is locked, and no operation can be done until the queue get call gets unlocked. |
|
Back to top |
|
 |
bob_buxton |
Posted: Tue Nov 04, 2003 6:29 am Post subject: |
|
|
 Master
Joined: 23 Aug 2001 Posts: 266 Location: England
|
rgarcia wrote: |
Thanks for your answers, but:
1.- I can't put a dumb message in the queue because there is more than one application that is using that queue, and I'm not sure which of them will get the message.
2.- I tried to Get-Disable the queue from another thread but I can't if it's locked in a get call. In fact, I think that is the QueueManager object that obtained the queue who is locked, and no operation can be done until the queue get call gets unlocked. |
The Inhibit Get technique would also effect all the applications using the queue. If each of your applications was using different message selection criteria you could target a Quit message to a specific application but in general I don't know of a way to end a spedific waiter other than cancelling the process.
There should be no reason that you can't inhibit get on a queue whilst another handle has a get wait outstanding.
What platform are you running on?
What open options are your handles using?
What reason codes are your MQ calls returning?
The setting handle must have speified MQOO_SET and should not specify MQOO_INPUT_EXCLUSIVE since that would cause a conflict with the other handle. _________________ Bob Buxton
Ex-Websphere MQ Development |
|
Back to top |
|
 |
|