Shan Wang wrote:
My client program will declare the queue in the beginning, but there's no point of redeclaring a queue if it already exists. Is there a API call for clients to tell if a queue name is being used already?
Probably the simplest is to use queueQuery() and then test that the name field of the result struct is the same as the queue you are querying. If the name on the result is empty then the queue does not exist.
Also maybe worth mentioning that there is a passive argument to queueDeclare() which if set causes the call to fail if the queue has not already been declared (e.g. if you merely want to assert that the queue has been created by some setup phase and not create it if it does not).
In terms of the queue being 'in use', there are two mechanisms for controlling that. You can have an 'exclusive' queue that only your session is allowed to use (use means subscriber to, delete, bind etc). You can also have an exclusive subscription on a shared queue (e.g. to ensure no one else is getting messages from that queue).
--------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:[email protected]
