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:[email protected]

Reply via email to