VOOZH about

URL: https://www.nuget.org/packages/JustSaying.FlexiblePublishers/

⇱ NuGet Gallery | JustSaying.FlexiblePublishers 8.1.21




JustSaying.FlexiblePublishers 8.1.21

dotnet add package JustSaying.FlexiblePublishers --version 8.1.21
 
 
NuGet\Install-Package JustSaying.FlexiblePublishers -Version 8.1.21
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="JustSaying.FlexiblePublishers" Version="8.1.21" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="JustSaying.FlexiblePublishers" Version="8.1.21" />
 
Directory.Packages.props
<PackageReference Include="JustSaying.FlexiblePublishers" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add JustSaying.FlexiblePublishers --version 8.1.21
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: JustSaying.FlexiblePublishers, 8.1.21"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package JustSaying.FlexiblePublishers@8.1.21
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=JustSaying.FlexiblePublishers&version=8.1.21
 
Install as a Cake Addin
#tool nuget:?package=JustSaying.FlexiblePublishers&version=8.1.21
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

JustSaying.FlexiblePublishers

A set of JustSaying IMessagePublisher replacements to perform different functions

Use latest v8 release for JustSaying v8, or v7 releases for JustSaying v7.

QueuedMessagePublisher

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.

Usage

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);
Configuring middleware:
x.ForTopic<TestMessage>(
 cfg =>
 {
 cfg.WithMiddlewareConfiguration(m =>
 {
 m.UseQueuedMessagesMiddleware();
 m.UseDefaults<TestMessage>(typeof(TestMessageHandler)); // Add default middleware pipeline
 });
 });
Using in app:

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);

Additional Notes

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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

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