![]() |
VOOZH | about |
dotnet add package JustSaying.FlexiblePublishers --version 8.1.21
NuGet\Install-Package JustSaying.FlexiblePublishers -Version 8.1.21
<PackageReference Include="JustSaying.FlexiblePublishers" Version="8.1.21" />
<PackageVersion Include="JustSaying.FlexiblePublishers" Version="8.1.21" />Directory.Packages.props
<PackageReference Include="JustSaying.FlexiblePublishers" />Project file
paket add JustSaying.FlexiblePublishers --version 8.1.21
#r "nuget: JustSaying.FlexiblePublishers, 8.1.21"
#:package JustSaying.FlexiblePublishers@8.1.21
#addin nuget:?package=JustSaying.FlexiblePublishers&version=8.1.21Install as a Cake Addin
#tool nuget:?package=JustSaying.FlexiblePublishers&version=8.1.21Install as a Cake Tool
A set of JustSaying IMessagePublisher replacements to perform different functions
Use latest v8 release for JustSaying v8, or v7 releases for JustSaying v7.
A publisher that queues messages to be published at a later time. This is useful for when you want to publish messages in UoW functionality and you don't want to send the messages until the UoW is committed.
When publishing a message it can be optionally marked as isWhitelisted. When processing the queue, all messages can be sent or only the ones marked as isWhitelisted.
A middleware is provided which add this functionality onto IHandlerAsync<> handlers automatically.
Either the IQueuedMessagePublisher interface can be registered into DI which wraps the IMessagePublisher instance, OR the IQueuedMessagePublisher can be registered for both IMessagePublisher resolutions and IQueuedMessagePublisher resolutions, which is better as 3rd party code messages will be queued into the UoW as expected.
These examples use SimpleInjector but the theory is the same for all.
Setting up:
// Example for existing IMessagePublisher registration
// container.RegisterSingleton(() => builder.BuildPublisher());
// Approach to wrap the built IMessagePublisher into a QueuedMessagePublisher, then register this as both IMessagePublisher and IQueuedMessagePublisher
var messagingRegistration = Lifestyle.Scoped.CreateRegistration(
() => new QueuedMessagePublisher(loggerFactory, () => builder.BuildPublisher()),
container);
container.AddRegistration(typeof(IMessagePublisher), messagingRegistration);
container.AddRegistration(typeof(IQueuedMessagePublisher), messagingRegistration);
x.ForTopic<TestMessage>(
cfg =>
{
cfg.WithMiddlewareConfiguration(m =>
{
m.UseQueuedMessagesMiddleware();
m.UseDefaults<TestMessage>(typeof(TestMessageHandler)); // Add default middleware pipeline
});
});
Publish a message normally:
private readonly IMessagePublisher _messagePublisher;
await _messagePublisher.PublishAsync(new TestMessage());
Publish a "isWhitelisted" message - this requires the IQueuedMessageInterface
private readonly IQueuedMessagePublisher _messagePublisher;
await _messagePublisher.PublishAsync(new TestMessage(), isWhitelisted: true);
If using elsewhere (UoW approach on web controllers), then the queue must be processed at the end of the request handler. If using with a fully manual implementation then the queue must be processed once ready.
There is an example middleware for just with JustSaying 7 in here, and the same approach can be provided to middlewares for Mediator, ASP.NET Core pipelines etc.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 netstandard2.1 is compatible. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 8.1.21 | 1,847 | 11/21/2025 |
| 8.1.15-pre.3 | 420 | 11/19/2025 |
| 8.1.12-pre.3 | 394 | 11/19/2025 |
| 7.1.2-pre.2 | 174 | 12/17/2024 |
| 7.1.1-pre.2 | 152 | 12/16/2024 |
| 7.0.3 | 6,217 | 10/22/2024 |
| 7.0.2 | 4,509 | 2/9/2024 |
| 7.0.1 | 1,622 | 2/9/2024 |
| 7.0.0 | 519 | 2/5/2024 |
| 1.0.20 | 239 | 2/2/2024 |
| 1.0.19 | 227 | 2/2/2024 |
| 1.0.17 | 209 | 2/2/2024 |
| 1.0.15 | 218 | 2/1/2024 |
| 1.0.13 | 218 | 2/1/2024 |
| 1.0.12 | 250 | 1/30/2024 |
| 1.0.11 | 370 | 6/20/2023 |
| 1.0.10 | 7,645 | 6/23/2022 |
| 1.0.9 | 15,519 | 11/11/2019 |
| 1.0.7 | 1,413 | 10/3/2019 |