You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gs...@apache.org on 2015/08/04 18:52:02 UTC
[1/2] qpid-proton git commit: PROTON-972: allow heartbeat to be
specified for BlockingConnection
Repository: qpid-proton
Updated Branches:
refs/heads/0.10.x 54d4c098d -> 8e3231d0b
PROTON-972: allow heartbeat to be specified for BlockingConnection
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/8fca85a2
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/8fca85a2
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/8fca85a2
Branch: refs/heads/0.10.x
Commit: 8fca85a27bd796fc896d79ba7e1bf0ed84b0df6b
Parents: 54d4c09
Author: Gordon Sim <gs...@redhat.com>
Authored: Mon Aug 3 22:04:20 2015 +0100
Committer: Gordon Sim <gs...@redhat.com>
Committed: Tue Aug 4 17:43:56 2015 +0100
----------------------------------------------------------------------
proton-c/bindings/python/proton/utils.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/8fca85a2/proton-c/bindings/python/proton/utils.py
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/proton/utils.py b/proton-c/bindings/python/proton/utils.py
index 880c466..062df5d 100644
--- a/proton-c/bindings/python/proton/utils.py
+++ b/proton-c/bindings/python/proton/utils.py
@@ -185,13 +185,13 @@ class BlockingConnection(Handler):
"""
A synchronous style connection wrapper.
"""
- def __init__(self, url, timeout=None, container=None, ssl_domain=None):
+ def __init__(self, url, timeout=None, container=None, ssl_domain=None, heartbeat=None):
self.timeout = timeout
self.container = container or Container()
self.container.timeout = self.timeout
self.container.start()
self.url = Url(url).defaults()
- self.conn = self.container.connect(url=self.url, handler=self, ssl_domain=ssl_domain, reconnect=False)
+ self.conn = self.container.connect(url=self.url, handler=self, ssl_domain=ssl_domain, reconnect=False, heartbeat=heartbeat)
self.wait(lambda: not (self.conn.state & Endpoint.REMOTE_UNINIT),
msg="Opening connection")
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[2/2] qpid-proton git commit: NO-JIRA: add default handling for
transport errors
Posted by gs...@apache.org.
NO-JIRA: add default handling for transport errors
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/8e3231d0
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/8e3231d0
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/8e3231d0
Branch: refs/heads/0.10.x
Commit: 8e3231d0b4a01e0ec01ed7ef3363b0750dca80b5
Parents: 8fca85a
Author: Gordon Sim <gs...@redhat.com>
Authored: Tue Aug 4 17:30:18 2015 +0100
Committer: Gordon Sim <gs...@redhat.com>
Committed: Tue Aug 4 17:44:11 2015 +0100
----------------------------------------------------------------------
proton-c/bindings/python/proton/handlers.py | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/8e3231d0/proton-c/bindings/python/proton/handlers.py
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/proton/handlers.py b/proton-c/bindings/python/proton/handlers.py
index 4288cf8..f4ad5a9 100644
--- a/proton-c/bindings/python/proton/handlers.py
+++ b/proton-c/bindings/python/proton/handlers.py
@@ -387,6 +387,23 @@ class MessagingHandler(Handler, Acking):
self.handlers.append(EndpointStateHandler(peer_close_is_error, self))
self.handlers.append(IncomingMessageHandler(auto_accept, self))
self.handlers.append(OutgoingMessageHandler(auto_settle, self))
+ self.fatal_conditions = ["amqp:unauthorized-access"]
+
+ def on_transport_error(self, event):
+ """
+ Called when some error is encountered with the transport over
+ which the AMQP connection is to be established. This includes
+ authentication errors as well as socket errors.
+ """
+ if event.transport.condition:
+ if event.transport.condition.info:
+ logging.error("%s: %s" % (event.transport.condition.name, event.transport.condition.description, event.transport.condition.info))
+ else:
+ logging.error("%s: %s" % (event.transport.condition.name, event.transport.condition.description))
+ if event.transport.condition.name in self.fatal_conditions:
+ event.connection.close()
+ else:
+ logging.error("Unspecified transport error")
def on_connection_error(self, event):
"""
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org