You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by GitBox <gi...@apache.org> on 2021/01/28 16:49:32 UTC

[GitHub] [qpid-proton] pjfawcett opened a new pull request #293: PROTON-2330-cpp-link-properties

pjfawcett opened a new pull request #293:
URL: https://github.com/apache/qpid-proton/pull/293


   In C++ API, allow setting of link properties via sender and receiver options
   Allow query of link properties set by remote end
   Add tests


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[GitHub] [qpid-proton] pjfawcett commented on pull request #293: PROTON-2330-cpp-link-properties

Posted by GitBox <gi...@apache.org>.
pjfawcett commented on pull request #293:
URL: https://github.com/apache/qpid-proton/pull/293#issuecomment-777393767


   Raised separate, sub-task, JIRA PROTON-2332 to cover just the work on link properties. 
   Squashed commits and re-worded commit message to standard format


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[GitHub] [qpid-proton] pjfawcett commented on a change in pull request #293: PROTON-2330-cpp-link-properties

Posted by GitBox <gi...@apache.org>.
pjfawcett commented on a change in pull request #293:
URL: https://github.com/apache/qpid-proton/pull/293#discussion_r566310723



##########
File path: cpp/src/link_test.cpp
##########
@@ -45,8 +55,107 @@ int test_link_name()
     return 0;
 }
 
+/*
+ * Want to test remote properties so need to run a container and make loopback links.
+ * Basing these classes on those used in container_test.cpp but reducing the checks on
+ * container logic as that is not the subject of these tests.
+ */
+
+class test_handler : public proton::messaging_handler {
+  public:
+    bool done;
+    bool had_receiver;
+    bool had_sender;
+
+    proton::listener listener;
+    proton::connection connection;
+
+    proton::receiver_options receiver_options;
+    proton::sender_options sender_options;
+
+    std::map<proton::symbol, proton::value> peer_receiver_properties;
+    std::map<proton::symbol, proton::value> peer_sender_properties;
+
+    test_handler(const proton::receiver_options &r_opts=proton::receiver_options(),
+                 const proton::sender_options &s_opts=proton::sender_options())
+        : done(false),
+          had_receiver(false),
+          had_sender(false),
+          receiver_options(r_opts),
+          sender_options(s_opts)
+    {}
+
+    void on_container_start(proton::container &c) PN_CPP_OVERRIDE {
+        listener = c.listen("//:5678"); // Dynamic port doesn't work on MAC build - presumably not allocated until later
+        connection = c.connect("//:5678");

Review comment:
       Will do




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[GitHub] [qpid-proton] jiridanek merged pull request #293: PROTON-2332: [C++] Allow access to link properties

Posted by GitBox <gi...@apache.org>.
jiridanek merged pull request #293:
URL: https://github.com/apache/qpid-proton/pull/293


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[GitHub] [qpid-proton] pjfawcett commented on a change in pull request #293: PROTON-2330-cpp-link-properties

Posted by GitBox <gi...@apache.org>.
pjfawcett commented on a change in pull request #293:
URL: https://github.com/apache/qpid-proton/pull/293#discussion_r573738559



##########
File path: cpp/src/link_test.cpp
##########
@@ -45,8 +55,107 @@ int test_link_name()
     return 0;
 }
 
+/*
+ * Want to test remote properties so need to run a container and make loopback links.
+ * Basing these classes on those used in container_test.cpp but reducing the checks on
+ * container logic as that is not the subject of these tests.
+ */

Review comment:
       @astitcher are you happy with the updated tests?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[GitHub] [qpid-proton] pjfawcett commented on a change in pull request #293: PROTON-2330-cpp-link-properties

Posted by GitBox <gi...@apache.org>.
pjfawcett commented on a change in pull request #293:
URL: https://github.com/apache/qpid-proton/pull/293#discussion_r566315615



##########
File path: cpp/src/link_test.cpp
##########
@@ -45,8 +55,107 @@ int test_link_name()
     return 0;
 }
 
+/*
+ * Want to test remote properties so need to run a container and make loopback links.
+ * Basing these classes on those used in container_test.cpp but reducing the checks on
+ * container logic as that is not the subject of these tests.
+ */

Review comment:
       I vacillated about which source file was the best home for these tests.  Happy to take your guidance and move them to the container tests.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[GitHub] [qpid-proton] astitcher commented on a change in pull request #293: PROTON-2330-cpp-link-properties

Posted by GitBox <gi...@apache.org>.
astitcher commented on a change in pull request #293:
URL: https://github.com/apache/qpid-proton/pull/293#discussion_r566256123



##########
File path: cpp/src/link_test.cpp
##########
@@ -45,8 +55,107 @@ int test_link_name()
     return 0;
 }
 
+/*
+ * Want to test remote properties so need to run a container and make loopback links.
+ * Basing these classes on those used in container_test.cpp but reducing the checks on
+ * container logic as that is not the subject of these tests.
+ */
+
+class test_handler : public proton::messaging_handler {
+  public:
+    bool done;
+    bool had_receiver;
+    bool had_sender;
+
+    proton::listener listener;
+    proton::connection connection;
+
+    proton::receiver_options receiver_options;
+    proton::sender_options sender_options;
+
+    std::map<proton::symbol, proton::value> peer_receiver_properties;
+    std::map<proton::symbol, proton::value> peer_sender_properties;
+
+    test_handler(const proton::receiver_options &r_opts=proton::receiver_options(),
+                 const proton::sender_options &s_opts=proton::sender_options())
+        : done(false),
+          had_receiver(false),
+          had_sender(false),
+          receiver_options(r_opts),
+          sender_options(s_opts)
+    {}
+
+    void on_container_start(proton::container &c) PN_CPP_OVERRIDE {
+        listener = c.listen("//:5678"); // Dynamic port doesn't work on MAC build - presumably not allocated until later
+        connection = c.connect("//:5678");

Review comment:
       You have to use a dynamic port for tests as you have no idea what environment they run in. It could be running an AMQP broker or something already!

##########
File path: cpp/src/link_test.cpp
##########
@@ -45,8 +55,107 @@ int test_link_name()
     return 0;
 }
 
+/*
+ * Want to test remote properties so need to run a container and make loopback links.
+ * Basing these classes on those used in container_test.cpp but reducing the checks on
+ * container logic as that is not the subject of these tests.
+ */

Review comment:
       You could add these tests to the container tests - the connection tests are equaly not essentially container tests either.

##########
File path: cpp/src/link_test.cpp
##########
@@ -45,8 +55,107 @@ int test_link_name()
     return 0;
 }
 
+/*
+ * Want to test remote properties so need to run a container and make loopback links.
+ * Basing these classes on those used in container_test.cpp but reducing the checks on
+ * container logic as that is not the subject of these tests.
+ */
+
+class test_handler : public proton::messaging_handler {
+  public:
+    bool done;
+    bool had_receiver;
+    bool had_sender;
+
+    proton::listener listener;
+    proton::connection connection;
+
+    proton::receiver_options receiver_options;
+    proton::sender_options sender_options;
+
+    std::map<proton::symbol, proton::value> peer_receiver_properties;
+    std::map<proton::symbol, proton::value> peer_sender_properties;
+
+    test_handler(const proton::receiver_options &r_opts=proton::receiver_options(),
+                 const proton::sender_options &s_opts=proton::sender_options())
+        : done(false),
+          had_receiver(false),
+          had_sender(false),
+          receiver_options(r_opts),
+          sender_options(s_opts)
+    {}
+
+    void on_container_start(proton::container &c) PN_CPP_OVERRIDE {
+        listener = c.listen("//:5678"); // Dynamic port doesn't work on MAC build - presumably not allocated until later
+        connection = c.connect("//:5678");

Review comment:
       The way to do this is: first start a listener with a listener address "//:0" then only when the listener on_open() event is fired then create a connection with the address extracted out of the listener.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[GitHub] [qpid-proton] pjfawcett commented on pull request #293: PROTON-2330-cpp-link-properties

Posted by GitBox <gi...@apache.org>.
pjfawcett commented on pull request #293:
URL: https://github.com/apache/qpid-proton/pull/293#issuecomment-795155092


   @astitcher can this be merged now?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org