[
https://issues.apache.org/jira/browse/PROTON-2307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17271803#comment-17271803
]
ASF GitHub Bot commented on PROTON-2307:
----------------------------------------
astitcher commented on a change in pull request #278:
URL: https://github.com/apache/qpid-proton/pull/278#discussion_r563847919
##########
File path: cpp/src/container_test.cpp
##########
@@ -179,6 +181,22 @@ int test_container_capabilities() {
ASSERT_EQUAL(th.peer_offered_capabilities[0], proton::symbol("offered"));
ASSERT_EQUAL(th.peer_desired_capabilities.size(), 1u);
ASSERT_EQUAL(th.peer_desired_capabilities[0], proton::symbol("desired"));
+ ASSERT_EQUAL(th.peer_properties.size(), 0u);
+ return 0;
+}
+
+int test_container_properties() {
+ proton::connection_options opts;
+ std::map<proton::symbol, proton::value> props = {
+ {"qpid.client_process", "test_process"},
+ {"qpid.client_pid", 123}
+ };
Review comment:
Yep, it would make a lot of sense to have an C++03 build. However given
it really is going away in a short while probably not worth the bother right
now - sorry you had to fix this for 03 when it's going away soon!
##########
File path: cpp/src/connection.cpp
##########
@@ -192,6 +193,13 @@ std::vector<symbol> connection::desired_capabilities()
const {
return get_multiple<std::vector<symbol> >(caps);
}
+std::map<symbol, value> connection::properties() const {
+ map<symbol, value> props(pn_connection_remote_properties(pn_object()));
+ std::map<symbol, value> props_ret;
+ get(props, props_ret);
+ return props_ret;
Review comment:
It's not the no properties case that is wasteful, it's the with
properties case. There it builds the proton::map unnecessarily and throws it
away. My replacement code doesn't use a proton::map at all. The whole process
is still annoyingly heavyweight, but at least this isn't going to be on the hot
path in any sensible use.
My guess is that you used code like mine initially but without the null
check (because it's the parallel to the capabilities code). But that doesn't
work and fails the unit test you provided.
As the code passes the unit test I'm reasonably sure it doesn't just decode
the first element!
----------------------------------------------------------------
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:
[email protected]
> Allow access to connection properties in cpp binding
> ----------------------------------------------------
>
> Key: PROTON-2307
> URL: https://issues.apache.org/jira/browse/PROTON-2307
> Project: Qpid Proton
> Issue Type: Improvement
> Components: cpp-binding
> Affects Versions: proton-c-0.33.0
> Reporter: Pete Fawcett
> Priority: Minor
> Labels: enhancement
>
> I would like to be able to set the "custom" properties on a connection using
> the C++ bindings.
> The initial reason for this is to allow a client program to set the
> "qpid.client_process" property on a connection to a broker as this is useful
> when identifying the connection on the QMF console.
> I have written code to enable this and hope to submit a pull request soon.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]