Add message auditing filtering functionality to NServiceBus.
See Milestones for release notes.
Already a Patron? skip past this section
It is expected that all developers either become a Patron to use NServiceBusExtensions. Go to licensing FAQ
Support this project by becoming a Sponsor. The company avatar will show up here with a website link. The avatar will also be added to all GitHub repositories under the NServiceBusExtensions organization.
Thanks to all the backing developers. Support this project by becoming a patron.
https://nuget.org/packages/NServiceBus.AuditFilter/
[IncludeInAudit]
public class MessageToIncludeAudit :
IMessage;
[IncludeInAudit]
public class MessageToIncludeAudit :
IMessage;
[ExcludeFromAudit]
public class MessageToExcludeFromAudit :
IMessage;
[ExcludeFromAudit]
public class MessageToExcludeFromAudit :
IMessage;
With include by default
configuration.FilterAuditQueue(FilterResult.IncludeInAudit);
With exclude by default
configuration.FilterAuditQueue(FilterResult.ExcludeFromAudit);
The fallback/default value can also be controlled by a delegate.
configuration.FilterAuditQueue(
filter: (instance, _) =>
{
if (instance is MyMessage)
{
return FilterResult.ExcludeFromAudit;
}
return FilterResult.IncludeInAudit;
});
The sample uses the Learning Transport and the resultant messages can be viewed in the Storage Directory.
[ExcludeFromAudit]
public class MessageToExcludeFromAudit :
IMessage;
[ExcludeFromAudit]
public class MessageToExcludeFromAudit :
IMessage;
[IncludeInAudit]
public class MessageToIncludeAudit :
IMessage;
[IncludeInAudit]
public class MessageToIncludeAudit :
IMessage;
endpointConfiguration.AuditProcessedMessagesTo("audit");
endpointConfiguration.FilterAuditQueue(
defaultFilter: FilterResult.IncludeInAudit);
Audit designed by Delwar Hossain from The Noun Project.