qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gordon Sim <g...@redhat.com>
Subject Re: Detecting queue existence with the messaging API.
Date Mon, 09 May 2011 11:44:39 GMT
On 05/05/2011 03:58 PM, Alan Conway wrote:
> Is there a neater way of testing for queue existence than this?
>
> def queue_exists(queue,broker):
> c = qpid.messaging.Connection(broker)
> c.open()
> s = c.session()
> try:
> try:
> s.sender(queue)
> return True
> except qpid.messaging.exceptions.NotFound:
> return False
> finally: c.close()

You could send a qmfv2 object-id query message and check the response. 
Not sure that is any neater though.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Mime
View raw message