Bug 1145141

Summary: qpid-stat -u to show outgoing objects for AMQP 1.0
Product: Red Hat Enterprise MRG Reporter: Pavel Moravec <pmoravec>
Component: qpid-cppAssignee: messaging-bugs <messaging-bugs>
Status: CLOSED UPSTREAM QA Contact: Messaging QE <messaging-qe-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0CC: jross
Target Milestone: 3.3Keywords: Improvement, Patch
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Cause: Consequence: Fix: Result:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-02-10 03:43:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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/

Comment 12 Red Hat Bugzilla 2025-02-10 03:43:03 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.