-
Notifications
You must be signed in to change notification settings - Fork 78
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
[Host] Abandon/dead letter (#356) #357
Conversation
e76c231
to
99c9b69
Compare
@zarusz the build action has not been triggered |
Hi @EtherZa, This implementation looks great! I’ve left a few minor comments for your review—one of them might be more appropriate for a separate PR to address as a standalone feature. Regarding the GitHub build trigger issue, I’m not entirely sure what’s happening. Could you try force-pushing again to see if that resolves it? Thanks for your contribution! |
99c9b69
to
031406e
Compare
Signed-off-by: Richard Pringle <[email protected]>
031406e
to
2d86fd9
Compare
Docs have been updated. Message properties are not as straight forward as it appears. I've added details to the comment above. Prob best to have it as a separate change.
It's building again!
It's a pleasure :) I have added a RabbitMQ configuration option The default is still to |
It looks like it was just delayed... |
|
@EtherZa I am happy to merge, however if possible perhaps you could increase coverage on some touched files to meet the coverage criteria? |
@zarusz I'll look at what I can add, but most of the infringements are due to reformatting (remove trailing space, etc) or gates on the transports that don't support ie. if (r.Result == ProcessResult.Abandon)
{
throw new NotSupportedException("Transport does not support abandoning messages");
} Do you want a test for each of these? |
Well, okay. Let's not bother. Please give me a thumbs up if you plan no more changes and then I will merge. |
Added
Abandon
response toConsumerErrorHandlerResult
to be used by supported transports to dead letter the message. Most transports don't support the feature without some form of customised flow, but ASB and RabbitMQ both do.Azure Service Bus
Implemented without restriction. Abandoned messages will be sent directly to the DLQ, failed messages will be retried until their maximum delivery count has been exceeded.
RabbitMQ
I don't have any experience with RabbitMQ, so I may have missed something; but the bus does not appear to limit how many times a message will be delivered if it is Nacked with requeue = true. As such, changing the code to fail with a requeue would be a dangerous breaking change as it could lead to an inifinite recursion in message processing for exisiting SMB users (unless I have missed something).
I have left the RabbitMq processing flow intact but with the expectation that a future change will provide tracking or some other safety net for the above scenario. Do you have a better option/insight into the RabbitMQ model?
Other transports
A
NotSupportedException
will be thrown ifIConsumerErrorHandler
returns with anAbandon
state.Application headers
With ASB currently being the major benefactor to this change, it becomes a bit of a moot point. ASB does not support header customisation when dead lettering a message (
DeadLetterReason
andDeadLetterErrorDescription
are both set, but that is the extent of the customization permitted).