如何使用python上的qpid 库接收存储在队列中的消息量?
我试过这样:
from qpid.messaging import *
broker_rcv = connect_address
address_rcv = queue_name + "; { node: { type: queue }, assert: never , create: never, mode: " + "browse" + " }"
connection_rcv = Connection(broker_rcv)
connection_rcv.open()
session_rcv = connection_rcv.session()
receiver = session_rcv.receiver(address_rcv)
print receiver.available()
它总是给我返回 0 条消息。