You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2008/11/24 15:07:58 UTC

svn commit: r720197 - /incubator/qpid/trunk/qpid/python/qmf/console.py

Author: tross
Date: Mon Nov 24 06:07:57 2008
New Revision: 720197

URL: http://svn.apache.org/viewvc?rev=720197&view=rev
Log:
Removed hooks for message credits.  This will be implemented correctly later.
The problem with exposing message credits to the API client is that the 
client doesn't know how many AMQP messages have been received, only how many
QMF messages.  Since remote agents batch QMF messages into AMQP messages,
message credits can't be handled at the QMF API level.

Modified:
    incubator/qpid/trunk/qpid/python/qmf/console.py

Modified: incubator/qpid/trunk/qpid/python/qmf/console.py
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/qmf/console.py?rev=720197&r1=720196&r2=720197&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/python/qmf/console.py (original)
+++ incubator/qpid/trunk/qpid/python/qmf/console.py Mon Nov 24 06:07:57 2008
@@ -171,11 +171,11 @@
   def __repr__(self):
     return "QMF Console Session Manager (brokers connected: %d)" % len(self.brokers)
 
-  def addBroker(self, target="localhost", initialTopicCredits=0xFFFFFFFF):
+  def addBroker(self, target="localhost"):
     """ Connect to a Qpid broker.  Returns an object of type Broker. """
     url = BrokerURL(target)
     broker = Broker(self, url.host, url.port, url.authMech, url.authName, url.authPass,
-                    ssl = url.scheme == URL.AMQPS, topicCredits=initialTopicCredits)
+                    ssl = url.scheme == URL.AMQPS)
     if not broker.isConnected and not self.manageConnections:
       raise Exception(broker.error)
 
@@ -1125,15 +1125,13 @@
   """ """
   SYNC_TIME = 60
 
-  def __init__(self, session, host, port, authMech, authUser, authPass,
-               ssl=False, topicCredits=0xFFFFFFFF):
+  def __init__(self, session, host, port, authMech, authUser, authPass, ssl=False):
     self.session  = session
     self.host = host
     self.port = port
     self.ssl = ssl
     self.authUser = authUser
     self.authPass = authPass
-    self.topicCredits = topicCredits
     self.agents = {}
     self.agents[(1,0)] = Agent(self, 0, "BrokerAgent")
     self.topicBound = False
@@ -1194,9 +1192,6 @@
       auth = ""
     return "amqp%s://%s%s:%d" % (ssl, auth, self.host, self.port or 5672)
 
-  def replenishCredits(self, credits):
-    self.amqpSession.message_flow(destination="tdest", unit=0, value=credits)
-
   def __repr__(self):
     if self.isConnected:
       return "Broker connected at: %s" % self.getUrl()
@@ -1230,8 +1225,8 @@
                                          accept_mode=self.amqpSession.accept_mode.none,
                                          acquire_mode=self.amqpSession.acquire_mode.pre_acquired)
       self.amqpSession.incoming("tdest").listen(self._replyCb)
-      self.amqpSession.message_set_flow_mode(destination="tdest", flow_mode=0)
-      self.amqpSession.message_flow(destination="tdest", unit=0, value=self.topicCredits)
+      self.amqpSession.message_set_flow_mode(destination="tdest", flow_mode=1)
+      self.amqpSession.message_flow(destination="tdest", unit=0, value=0xFFFFFFFF)
       self.amqpSession.message_flow(destination="tdest", unit=1, value=0xFFFFFFFF)
 
       self.isConnected = True