qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alan Conway <acon...@redhat.com>
Subject Detecting queue existence with the messaging API.
Date Thu, 05 May 2011 14:58:13 GMT
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()


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


Mime
View raw message