New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(disposition): support undeliverable-here in modified outcomes #9
Conversation
@grs here is the amqp10-based test case:
NOTE: this requires a local queue named |
@@ -79,6 +79,9 @@ OutgoingFromQueue::OutgoingFromQueue(Broker& broker, const std::string& source, | |||
|
|||
void OutgoingFromQueue::init() | |||
{ | |||
// observe queue for changes to track undeliverable messages | |||
queue->getObservers().add(boost::shared_ptr<QueueObserver>(shared_from_this())); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible, I'd really like to make the tracking lazy, only activating if actually requested/needed, and only then registering the queue observer and tracking the messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure that sounds reasonable. you think its enough to just register it during handle
below, with a boolean flag on the class?
(actually maybe just making the SequenceSet
and optional would solve the requirement for the boolean, and marginally reduce memory consumption?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either of those works. One other point is that we need to deregister the observer when the consumer ends.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wondered about that. From other examples of QueueObserver's in the codebase I didn't see anything that explicitly removed itself from the observer list, so assumed (dangerously/lazily 😄) it was cleaned up automatically somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one more question here: is the right place to stop observation in detached
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
76d635b
to
5bb9028
Compare
@grs okay I think that should take care of your comments from yesterday. PS I @mentioned you in the most recent commit to this repo which breaks the build at least for me locally by duplicating a |
Previously, specifying `undeliverable-here` as `true` in a modified outcome simply resulted in the message being rejected. This patch adds tracking to the outgoing link management in order to not redeliver messages to links that indicate that messages are not deliverable there.
5bb9028
to
84a7913
Compare
Looks good, thanks! Can you attach this as a patch to a JIRA? As qpid-cpp is still in svn I don't think I can merge the PR directly. |
@grs sure thing, I'll do you one better: https://patch-diff.githubusercontent.com/raw/apache/qpid/pull/9.patch |
Actually, I've confirmed a patch isn't necessary. I can use your PR branch. I'll give this a test today and all going well merge it in. |
@mbroadst this is now committed. I somehow messed up the intended merge commit (I think perhaps on git svn rebase), so I'm afraid I neither marked the JIRA for this (https://issues.apache.org/jira/browse/QPID-7324) nor kept your name in the commit log. Thanks very much for the contribution though! |
@grs no worries, it's the functionality I'm after not the attribution 😄 |
Previously, specifying
undeliverable-here
astrue
in a modifiedoutcome simply resulted in the message being rejected. This patch
adds tracking to the outgoing link management in order to not
redeliver messages to links that indicate that messages are not
deliverable there.