Bug 1145141 - qpid-stat -u to show outgoing objects for AMQP 1.0
Summary: qpid-stat -u to show outgoing objects for AMQP 1.0
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp
Version: 3.0
Hardware: All
OS: All
medium
medium
Target Milestone: 3.3
: ---
Assignee: messaging-bugs
QA Contact: Messaging QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-22 13:19 UTC by Pavel Moravec
Modified: 2024-01-19 19:10 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Cause: Consequence: Fix: Result:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Apache JIRA QPID-6113 0 None None None Never
Red Hat Knowledge Base (Solution) 1203463 0 None None None Never

Description Pavel Moravec 2014-09-22 13:19:53 UTC
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:

Comment 1 Pavel Moravec 2014-09-22 13:34:24 UTC
See also relevant https://bugzilla.redhat.com/show_bug.cgi?id=1145145: "transfers" counter in incoming/outgoing QMF objects is not updated.

Comment 2 Pavel Moravec 2014-09-22 16:22:40 UTC
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)

Comment 3 Pavel Moravec 2014-09-23 12:50:27 UTC
Review request for a patch extending "qpid-stat -u" to cover Outgoings: https://reviews.apache.org/r/25938/


Note You need to log in before you can comment on or make changes to this bug.