Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-1126

Allow setting connection properties in BlockingConnection

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.11.1
    • Fix Version/s: 0.13.0
    • Component/s: python-binding
    • Labels:
      None

      Description

      The BlockingConnection class in proton/bindings/python/proton/utils.py does not have a way to set the connection properties.

      connection properties are sent as part of the AMQP open frame.
      Allow the connection properties to be set on the BlockingConnection

        Activity

        Hide
        ganeshmurthy Ganesh Murthy added a comment -

        See if you can also allow setting the offered_capabilities and desired_capabilities

        Show
        ganeshmurthy Ganesh Murthy added a comment - See if you can also allow setting the offered_capabilities and desired_capabilities
        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user ganeshmurthy opened a pull request:

        https://github.com/apache/qpid-proton/pull/64

        PROTON-1126 - Allowed setting connection properties, offered_capabili…

        …ties and desired_capabilities on BlockingConnection

        You can merge this pull request into a Git repository by running:

        $ git pull https://github.com/ganeshmurthy/qpid-proton PROTON-1126

        Alternatively you can review and apply these changes as the patch at:

        https://github.com/apache/qpid-proton/pull/64.patch

        To close this pull request, make a commit to your master/trunk branch
        with (at least) the following in the commit message:

        This closes #64


        commit ba05b7a10f9941f4e16359ff4b49020545ab3a36
        Author: Ganesh Murthy <gmurthy@redhat.com>
        Date: 2016-02-04T15:12:28Z

        PROTON-1126 - Allowed setting connection properties, offered_capabilities and desired_capabilities on BlockingConnection


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user ganeshmurthy opened a pull request: https://github.com/apache/qpid-proton/pull/64 PROTON-1126 - Allowed setting connection properties, offered_capabili… …ties and desired_capabilities on BlockingConnection You can merge this pull request into a Git repository by running: $ git pull https://github.com/ganeshmurthy/qpid-proton PROTON-1126 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/qpid-proton/pull/64.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #64 commit ba05b7a10f9941f4e16359ff4b49020545ab3a36 Author: Ganesh Murthy <gmurthy@redhat.com> Date: 2016-02-04T15:12:28Z PROTON-1126 - Allowed setting connection properties, offered_capabilities and desired_capabilities on BlockingConnection
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user grs commented on a diff in the pull request:

        https://github.com/apache/qpid-proton/pull/64#discussion_r51931427

        — Diff: proton-c/bindings/python/proton/_init_.py —
        @@ -2445,10 +2445,10 @@ def wrap(impl):
        else:
        return Connection(impl)

        • def _init_(self, impl = pn_connection):
          + def _init_(self, impl=pn_connection):
            • End diff –

        don't need this

        Show
        githubbot ASF GitHub Bot added a comment - Github user grs commented on a diff in the pull request: https://github.com/apache/qpid-proton/pull/64#discussion_r51931427 — Diff: proton-c/bindings/python/proton/_ init _.py — @@ -2445,10 +2445,10 @@ def wrap(impl): else: return Connection(impl) def _ init _(self, impl = pn_connection): + def _ init _(self, impl=pn_connection): End diff – don't need this
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user grs commented on a diff in the pull request:

        https://github.com/apache/qpid-proton/pull/64#discussion_r51931488

        — Diff: proton-c/bindings/python/proton/_init_.py —
        @@ -2445,10 +2445,10 @@ def wrap(impl):
        else:
        return Connection(impl)

        • def _init_(self, impl = pn_connection):
          + def _init_(self, impl=pn_connection):
          Wrapper._init_(self, impl, pn_connection_attachments)
        • def _init(self):
          + def _init(self, **kwargs):
            • End diff –

        don't need this

        Show
        githubbot ASF GitHub Bot added a comment - Github user grs commented on a diff in the pull request: https://github.com/apache/qpid-proton/pull/64#discussion_r51931488 — Diff: proton-c/bindings/python/proton/_ init _.py — @@ -2445,10 +2445,10 @@ def wrap(impl): else: return Connection(impl) def _ init _(self, impl = pn_connection): + def _ init _(self, impl=pn_connection): Wrapper._ init _(self, impl, pn_connection_attachments) def _init(self): + def _init(self, **kwargs): End diff – don't need this
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user grs commented on a diff in the pull request:

        https://github.com/apache/qpid-proton/pull/64#discussion_r51931527

        — Diff: proton-c/bindings/python/proton/reactor.py —
        @@ -671,7 +671,11 @@ def connect(self, url=None, urls=None, address=None, handler=None, reconnect=Non
        """
        conn = self.connection(handler)
        conn.container = self.container_id or str(generate_uuid())
        -
        +
        + conn.offered_capabilities = kwargs.get('offered_capabilities')
        + conn.desired_capabilities = kwargs.get('desired_capabilities')
        + conn.properties = kwargs.get('properties')
        — End diff –

        looks good

        Show
        githubbot ASF GitHub Bot added a comment - Github user grs commented on a diff in the pull request: https://github.com/apache/qpid-proton/pull/64#discussion_r51931527 — Diff: proton-c/bindings/python/proton/reactor.py — @@ -671,7 +671,11 @@ def connect(self, url=None, urls=None, address=None, handler=None, reconnect=Non """ conn = self.connection(handler) conn.container = self.container_id or str(generate_uuid()) - + + conn.offered_capabilities = kwargs.get('offered_capabilities') + conn.desired_capabilities = kwargs.get('desired_capabilities') + conn.properties = kwargs.get('properties') — End diff – looks good
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user grs commented on a diff in the pull request:

        https://github.com/apache/qpid-proton/pull/64#discussion_r51931699

        — Diff: tests/python/proton_tests/utils.py —
        @@ -72,6 +76,24 @@ def wait(self):
        self.event.wait(self.timeout)

        +class ConnPropertiesServer(EchoServer):
        + def _init_(self, url, timeout):
        + EchoServer._init_(self, url, timeout)
        + self.properties_received = False
        + self.offered_capabilities_received = False
        + self.desired_capabilities_received = False
        +
        + def on_link_opening(self, event):
        — End diff –

        this is fine; could also be on_connection_opening which might be clearer in intent, but this works also

        Show
        githubbot ASF GitHub Bot added a comment - Github user grs commented on a diff in the pull request: https://github.com/apache/qpid-proton/pull/64#discussion_r51931699 — Diff: tests/python/proton_tests/utils.py — @@ -72,6 +76,24 @@ def wait(self): self.event.wait(self.timeout) +class ConnPropertiesServer(EchoServer): + def _ init _(self, url, timeout): + EchoServer._ init _(self, url, timeout) + self.properties_received = False + self.offered_capabilities_received = False + self.desired_capabilities_received = False + + def on_link_opening(self, event): — End diff – this is fine; could also be on_connection_opening which might be clearer in intent, but this works also
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 0c8ba1df78fac9bebfda6b08f88105ff1b20d219 in qpid-proton's branch refs/heads/master from Gordon Sim
        [ https://git-wip-us.apache.org/repos/asf?p=qpid-proton.git;h=0c8ba1d ]

        PROTON-1126: allow setting of various connection fields. Patch from Ganesh Murthy.

        Show
        jira-bot ASF subversion and git services added a comment - Commit 0c8ba1df78fac9bebfda6b08f88105ff1b20d219 in qpid-proton's branch refs/heads/master from Gordon Sim [ https://git-wip-us.apache.org/repos/asf?p=qpid-proton.git;h=0c8ba1d ] PROTON-1126 : allow setting of various connection fields. Patch from Ganesh Murthy.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user ganeshmurthy closed the pull request at:

        https://github.com/apache/qpid-proton/pull/64

        Show
        githubbot ASF GitHub Bot added a comment - Github user ganeshmurthy closed the pull request at: https://github.com/apache/qpid-proton/pull/64
        Hide
        justi9 Justin Ross added a comment -
        Show
        justi9 Justin Ross added a comment - Released in Qpid Proton 0.13.0, http://qpid.apache.org/releases/qpid-proton-0.13.0/index.html

          People

          • Assignee:
            ganeshmurthy Ganesh Murthy
            Reporter:
            ganeshmurthy Ganesh Murthy
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development