[ https://issues.apache.org/jira/browse/PROTON-2370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17320527#comment-17320527 ]
ASF GitHub Bot commented on PROTON-2370: ---------------------------------------- jiridanek commented on a change in pull request #309: URL: https://github.com/apache/qpid-proton/pull/309#discussion_r612761509 ########## File path: cpp/src/delivery.cpp ########## @@ -40,6 +42,7 @@ namespace proton { delivery::delivery(pn_delivery_t* d): transfer(make_wrapper(d)) {} receiver delivery::receiver() const { return make_wrapper<class receiver>(pn_delivery_link(pn_object())); } +tag delivery::tag() const { return make_wrapper<class tag>(pn_delivery_tag(pn_object())); } Review comment: I think so. If you look at the tests that @pjfawcett wrote for these two enhancements https://github.com/apache/qpid-proton/pulls?q=is%3Apr+author%3Apjfawcett , you'll see that there are tests that set something when a message is being sent/link is being created/... and then the tests check it on the receiving end. **I think that this would be a good test in addition to what you have already. It demonstrates that an end-user of the library is actually able to use the tags.** As you know, in AMQP you can set a tag when you are sending a message and you will see the tag in the receiver when your program decides whether to accept the message, and then again the tag is given back to the sender in the delivery after the message has been disposed of. Looking at the C++ binding, I see that when I send a message, I won't be able to set my own tag, because the binding sets it for me (and tries moderately hard to give unique tag). For example, in the Python binding, there is `def send(self, sender, tag=None):` method in `message.py` so there I can set my own tag. https://github.com/apache/qpid-proton/blob/8ddf5399013b02f1fd13bda3fee7886bd48a98be/cpp/src/sender.cpp#L62-L72 When I receive the message, I will be able to read the delivery tag in the `on_message` handler method https://github.com/apache/qpid-proton/blob/8ddf5399013b02f1fd13bda3fee7886bd48a98be/cpp/examples/flow_control.cpp#L181 Finally, when the message is settled in the `on_message` handler of the receiver (using one of the `.accept()`, `reject()`, ... methods, I want to be able to see in the sender the final disposition and the tag. That should cause the handler method `on_tracker_accept`/`on_tracker_reject`/... to be called. **Problem is, I cannot access the delivery and therefore the delivery from that method, at least I did not see a way!** https://github.com/apache/qpid-proton/blob/8ddf5399013b02f1fd13bda3fee7886bd48a98be/cpp/examples/direct_send.cpp#L76 -- 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: us...@infra.apache.org > [cpp] An accessor for the delivery tag > -------------------------------------- > > Key: PROTON-2370 > URL: https://issues.apache.org/jira/browse/PROTON-2370 > Project: Qpid Proton > Issue Type: Improvement > Components: cpp-binding > Reporter: Justin Ross > Priority: Major > > *Assignee: Rakhi* > Steps: > * Get familiar with the AMQP idea of a delivery tag > * Add a delivery tag accessor to the C++ delivery class > * Document the accessor in the C++ header > * Add a test for the accessor to the C++ test suite > Resources: > * > [http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-transport-v1.0-os.html#doc-idp438000] > * > [http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-transport-v1.0-os.html#type-delivery-tag] > * > [https://github.com/apache/qpid-proton/blob/main/c/include/proton/delivery.h#L106] > * > [https://github.com/apache/qpid-proton/blob/main/cpp/include/proton/delivery.hpp] -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org