summaryrefslogtreecommitdiff
path: root/python/qpid/messaging/util.py
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2010-04-09 10:54:07 +0000
committerRafael H. Schloming <rhs@apache.org>2010-04-09 10:54:07 +0000
commitdf0f59227e5947aa4620e8c319823e96c5796234 (patch)
tree8455f285068e911137d753f7c390781432032373 /python/qpid/messaging/util.py
parent7a0d795940c5c68383b0224740f085e8e6b4e60b (diff)
downloadqpid-python-df0f59227e5947aa4620e8c319823e96c5796234.tar.gz
Changes to connection lifecycle methods and Connection parameters:
- Connection.open -> Connection.establish - Connection.connect() split into Connection.open(), Connection.attach() - Connection.disconnect() -> Connection.detach() - reconnect_hosts -> reconnect_urls - transport now takes tcp, ssl, and tcp+tls git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@932352 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid/messaging/util.py')
-rw-r--r--python/qpid/messaging/util.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/python/qpid/messaging/util.py b/python/qpid/messaging/util.py
index 30b54f3ad4..42bc280454 100644
--- a/python/qpid/messaging/util.py
+++ b/python/qpid/messaging/util.py
@@ -26,31 +26,31 @@ from threading import Thread
log = getLogger("qpid.messaging.util")
-def auto_fetch_reconnect_hosts(conn):
- ssn = conn.session("auto-fetch-reconnect-hosts")
+def auto_fetch_reconnect_urls(conn):
+ ssn = conn.session("auto-fetch-reconnect-urls")
rcv = ssn.receiver("amq.failover")
rcv.capacity = 10
def main():
while True:
msg = rcv.fetch()
- set_reconnect_hosts(conn, msg)
+ set_reconnect_urls(conn, msg)
ssn.acknowledge(msg, sync=False)
- thread = Thread(name="auto-fetch-reconnect-hosts", target=main)
+ thread = Thread(name="auto-fetch-reconnect-urls", target=main)
thread.setDaemon(True)
thread.start()
-def set_reconnect_hosts(conn, msg):
- reconnect_hosts = []
+def set_reconnect_urls(conn, msg):
+ reconnect_urls = []
urls = msg.properties["amq.failover"]
for u in urls:
if u.startswith("amqp:tcp:"):
parts = u.split(":")
host, port = parts[2:4]
- reconnect_hosts.append((host, port))
- conn.reconnect_hosts = reconnect_hosts
- log.warn("set reconnect_hosts for conn %s: %s", conn, reconnect_hosts)
+ reconnect_urls.append("%s:%s" % (host, port))
+ conn.reconnect_urls = reconnect_urls
+ log.warn("set reconnect_urls for conn %s: %s", conn, reconnect_urls)
-__all__ = ["auto_fetch_reconnect_hosts", "set_reconnect_hosts"]
+__all__ = ["auto_fetch_reconnect_urls", "set_reconnect_urls"]