Description of problem: qpid-stat -u serves as a good command for understanding what consumers of what queues there exist. But for an AMQP 1.0 consumer, the command does not list "AMQP 1.0 subscription" as the consumer link is maintained in Outgoing QMF object. But qpid-stat cant cope with outgoing (or incoming) objects. It is required to: - either have an option -o (and optionally -i) for listing outgoing (optionally incoming) links - or enhance "qpid-stat -u" by listing AMQP 1.0 outgoing links Version-Release number of selected component (if applicable): qpid-cpp-server 0.22-48 How reproducible: 100% Steps to Reproduce: 1. qpid-receive -a "someQueue; {create:always}" --connection-option "{protocol:amqp1.0}" -f & 2. qpid-stat -u Actual results: There is no subscription of someQueue. There is no way to see the outgoing links in via either qpid-stat option. Expected results: Some qpid-stat option to list outgoing links. Additional info:
See also relevant https://bugzilla.redhat.com/show_bug.cgi?id=1145145: "transfers" counter in incoming/outgoing QMF objects is not updated.
In-mature but working patch: Index: tools/src/py/qpid-stat =================================================================== --- tools/src/py/qpid-stat (revision 1626808) +++ tools/src/py/qpid-stat (working copy) @@ -385,6 +385,7 @@ heads.append(Header("sessUnacked", Header.COMMAS)) rows = [] subscriptions = self.broker.getAllSubscriptions() + outgoings = self.broker.getAllOutgoings() sessions = self.getSessionMap() connections = self.getConnectionMap() for s in subscriptions: @@ -406,6 +407,25 @@ rows.append(row) except: pass + for o in outgoings: + row = [] + try: + row.append(o.name) + row.append(o.source) + session = sessions[o.sessionRef] + connection = connections[session.connectionRef] + row.append(connection.address) + row.append(connection.remoteProcessName) + row.append(connection.remotePid) + row.append(False) # browsing - False everytime? + row.append(False) # acknowledged + row.append(False) # exclusive + row.append("AMQP1.0") #credit mode - check with spec + row.append(o.transfers) + row.append(session.unackedMessages) + rows.append(row) + except: + pass title = "Subscriptions" if config._sortcol: sorter = Sorter(heads, rows, config._sortcol, config._limit, config._increasing) Index: tools/src/py/qpidtoollibs/broker.py =================================================================== --- tools/src/py/qpidtoollibs/broker.py (revision 1626808) +++ tools/src/py/qpidtoollibs/broker.py (working copy) @@ -193,6 +193,9 @@ def getAllLinks(self): return self._getAllBrokerObjects(Link) + def getAllOutgoings(self): + return self._getAllBrokerObjects(Outgoing) + def getAcl(self): return self._getSingleObject(Acl) @@ -481,6 +484,10 @@ def __init__(self, broker, values): BrokerObject.__init__(self, broker, values) +class Outgoing(BrokerObject): + def __init__(self, broker, values): + BrokerObject.__init__(self, broker, values) + class Acl(BrokerObject): def __init__(self, broker, values): BrokerObject.__init__(self, broker, values)
Review request for a patch extending "qpid-stat -u" to cover Outgoings: https://reviews.apache.org/r/25938/