Author |
Message
|
andy840920 |
Posted: Mon May 28, 2007 6:06 am Post subject: how to query queue depth not int while |
|
|
Apprentice
Joined: 29 Apr 2007 Posts: 44
|
Code: |
while (MQINQ(...) > 0)
sleep(1);
|
my application continue when the queue depth equals 0. but i can't find wait api in MQ. i must query in a while loop and sleep 1 seconds. has some others methods? |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon May 28, 2007 6:33 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
DON'T DO THAT.
Specify a WaitInterval on the GET, and loop until GET returns a 2033 - no more messages. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
andy840920 |
Posted: Tue May 29, 2007 5:49 am Post subject: |
|
|
Apprentice
Joined: 29 Apr 2007 Posts: 44
|
jefflowrey wrote: |
DON'T DO THAT.
Specify a WaitInterval on the GET, and loop until GET returns a 2033 - no more messages. |
why don't do that???
two processes, one GET from the queue in a while, and the other do something must after the first process GET over. so the second process should QMINQ the queue depth. the first process is a java application. the second is a c application. how to do? |
|
Back to top |
|
 |
Vitor |
Posted: Tue May 29, 2007 6:02 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
andy840920 wrote: |
why don't do that??? |
Because the queue depth is affected by a number of factors and the number you get back may not be what you expect. Search the forum for a number of discussions on this matter.
andy840920 wrote: |
two processes, one GET from the queue in a while, and the other do something must after the first process GET over. so the second process should QMINQ the queue depth. the first process is a java application. the second is a c application. how to do? |
Both processes must read their queues with a wait interval, as has been suggested to you. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue May 29, 2007 10:58 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
If you have two processes written in two different languages, then it's very likely that they do two different things.
In which case, they should not be sharing a queue. Every application that needs to GET messages deserves it's own individual queue. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Vitor |
Posted: Tue May 29, 2007 11:59 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Vitor wrote: |
Both processes must read their queues with a wait interval, as has been suggested to you. |
I thank jefflowrey for highlighting an issue I should have been clearer about  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|