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 » IBM MQ API Support » how to query queue depth not int while

Post new topic  Reply to topic
 how to query queue depth not int while « View previous topic :: View next topic » 
Author Message
andy840920
PostPosted: Mon May 28, 2007 6:06 am    Post subject: how to query queue depth not int while Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Mon May 28, 2007 6:33 am    Post subject: Reply with quote

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
View user's profile Send private message
andy840920
PostPosted: Tue May 29, 2007 5:49 am    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Tue May 29, 2007 6:02 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Tue May 29, 2007 10:58 am    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Tue May 29, 2007 11:59 pm    Post subject: Reply with quote

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
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 » IBM MQ API Support » how to query queue depth not int while
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.