diff options
| author | Gordon Sim <gsim@apache.org> | 2008-05-12 17:04:07 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2008-05-12 17:04:07 +0000 |
| commit | 0655ff5aceb9d53eb256a05d7beb55b1c803c8de (patch) | |
| tree | d478a719d5a5d030c3e228d298c6be8378d4fe44 /python/commands | |
| parent | 4a1605e6b357c251398aca281b90452c1cbd5ab2 (diff) | |
| download | qpid-python-0655ff5aceb9d53eb256a05d7beb55b1c803c8de.tar.gz | |
QPID-1050: Patch from Ted Ross:
1) Durability for federation links (broker-to-broker connections)
2) Improved handling of federation links:
a) Links can be created even if the remote broker is not reachable
b) If links are lost, re-establishment will occur using an exponential back-off algorithm
3) Durability of exchanges is now viewable through management
4) ManagementAgent API has been moved to an interface class to reduce coupling between the broker and manageable plug-ins.
5) General configuration storage capability has been added to the store/recover interface. This is used for federation links.
6) Management object-ids for durable objects are now themselves durable.
(Note: some refactoring needed around ProtocolAccess needed to try and reduce dependencies)
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@655563 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/commands')
| -rwxr-xr-x | python/commands/qpid-config | 14 | ||||
| -rwxr-xr-x | python/commands/qpid-route | 18 |
2 files changed, 19 insertions, 13 deletions
diff --git a/python/commands/qpid-config b/python/commands/qpid-config index 8f2fb7ff1b..23a054f497 100755 --- a/python/commands/qpid-config +++ b/python/commands/qpid-config @@ -96,9 +96,9 @@ class BrokerManager: self.conn = Connection (connect (self.broker.host, self.broker.port), self.spec, username=self.broker.username, password=self.broker.password) self.conn.start () - self.session = self.conn.session(str(uuid4())) + self.session = self.conn.session (self.sessionId) self.mclient = managementClient (self.spec) - self.mchannel = self.mclient.addChannel (self.conn.session(self.sessionId)) + self.mchannel = self.mclient.addChannel (self.session) except socket.error, e: print "Socket Error:", e sys.exit (1) @@ -141,11 +141,11 @@ class BrokerManager: mch = self.mchannel mc.syncWaitForStable (mch) exchanges = mc.syncGetObjects (mch, "exchange") - print "Type Bindings Exchange Name" - print "=============================================" + print "Durable Type Bindings Exchange Name" + print "=======================================================" for ex in exchanges: if self.match (ex.name, filter): - print "%-10s%5d %s" % (ex.type, ex.bindings, ex.name) + print "%4c %-10s%5d %s" % (YN (ex.durable), ex.type, ex.bindings, ex.name) def ExchangeListRecurse (self, filter): self.ConnectToBroker () @@ -278,7 +278,7 @@ class BrokerManager: key = args[2] try: - self.session.exchange_bind (queue=qname, exchange=ename, routing_key=key) + self.session.exchange_bind (queue=qname, exchange=ename, binding_key=key) except Closed, e: print "Failed:", e @@ -293,7 +293,7 @@ class BrokerManager: key = args[2] try: - self.session.exchange_unbind (queue=qname, exchange=ename, routing_key=key) + self.session.exchange_unbind (queue=qname, exchange=ename, binding_key=key) except Closed, e: print "Failed:", e diff --git a/python/commands/qpid-route b/python/commands/qpid-route index baa45a320f..e59f89480e 100755 --- a/python/commands/qpid-route +++ b/python/commands/qpid-route @@ -83,7 +83,7 @@ class RouteManager: def getLink (self): links = self.mclient.syncGetObjects (self.mch, "link") for link in links: - if link.address == self.src.name (): + if "%s:%d" % (link.host, link.port) == self.src.name (): return link return None @@ -100,8 +100,13 @@ class RouteManager: print "Inter-broker link not found, creating..." connectArgs = {} - connectArgs["host"] = self.src.host - connectArgs["port"] = self.src.port + connectArgs["host"] = self.src.host + connectArgs["port"] = self.src.port + connectArgs["useSsl"] = False + connectArgs["durable"] = False + connectArgs["authMechanism"] = "ANONYMOUS" + connectArgs["username"] = "" + connectArgs["password"] = "" res = mc.syncCallMethod (self.mch, broker.id, broker.classKey, "connect", connectArgs) if _verbose: print "Connect method returned:", res.status, res.statusText @@ -122,6 +127,7 @@ class RouteManager: if _verbose: print "Creating inter-broker binding..." bridgeArgs = {} + bridgeArgs["durable"] = 0 bridgeArgs["src"] = exchange bridgeArgs["dest"] = exchange bridgeArgs["key"] = routingKey @@ -180,7 +186,7 @@ class RouteManager: myLink = link break if myLink != None: - print "%s %s %s %s" % (self.dest.name(), myLink.address, bridge.dest, bridge.key) + print "%s %s:%d %s %s" % (self.dest.name(), myLink.host, myLink.port, bridge.dest, bridge.key) def LoadRoutes (self, inFile): pass @@ -198,7 +204,7 @@ class RouteManager: myLink = link break if myLink != None: - print "Deleting Bridge: %s %s %s... " % (myLink.address, bridge.dest, bridge.key), + print "Deleting Bridge: %s:%d %s %s... " % (myLink.host, myLink.port, bridge.dest, bridge.key), res = mc.syncCallMethod (self.mch, bridge.id, bridge.classKey, "close") if res.status != 0: print "Error: %d - %s" % (res.status, res.statusText) @@ -208,7 +214,7 @@ class RouteManager: links = mc.syncGetObjects (self.mch, "link") for link in links: if _verbose: - print "Deleting Link: %s... " % link.address, + print "Deleting Link: %s:%d... " % (link.host, link.port), res = mc.syncCallMethod (self.mch, link.id, link.classKey, "close") if res.status != 0: print "Error: %d - %s" % (res.status, res.statusText) |
