Aspire4RabbitMQDelayedMessageExchange 1.0.0
dotnet add package Aspire4RabbitMQDelayedMessageExchange --version 1.0.0
NuGet\Install-Package Aspire4RabbitMQDelayedMessageExchange -Version 1.0.0
<PackageReference Include="Aspire4RabbitMQDelayedMessageExchange" Version="1.0.0" />
paket add Aspire4RabbitMQDelayedMessageExchange --version 1.0.0
#r "nuget: Aspire4RabbitMQDelayedMessageExchange, 1.0.0"
// Install Aspire4RabbitMQDelayedMessageExchange as a Cake Addin #addin nuget:?package=Aspire4RabbitMQDelayedMessageExchange&version=1.0.0 // Install Aspire4RabbitMQDelayedMessageExchange as a Cake Tool #tool nuget:?package=Aspire4RabbitMQDelayedMessageExchange&version=1.0.0
Aspire4Wasm
An easy way to leverage RabbitMQ's Delayed Message Exchange Plugin in Aspire hosted applications using just one line of code. This allows you to use NServiceBus or MassTransit or the .NET messaging library of your choice with RabbitMQ and have the ability to delay delivery of messages. Don't need the source code? Just get the Nuget package: https://www.nuget.org/packages/Aspire4RabbitMQDelayedMessageExchange/
Problem statement
.NET Aspire supports the official Management Plugin for RabbitMQ, adding a web GUI for inspecting queues and exchanges of the popular message broker. However, it currently doesn't currently (as of early 2025) support adding the Delayed Message Exchange Plugin.
My little library Aspire4RabbitMQDelayedMessageExchange solves the problem by writing a docker file to a temporary location inside your AppHost for you and running it in Docker as part of your distributed application.
Quickstart
- Install Aspire4RabbitMQDelayedMessageExchange in your AppHost project via the Nuget package.
- In your AppHost project's Program.cs file, after your call to
AddRabbitMQ
chain a call toWithDelayedDeliveryPlugin
. - There is no 3. You are done! You can now use delayed message exchanges as directed by your messaging library (e.g. MassTransit, NServiceBus etc.)
Example Program.cs in AppHost
var builder = DistributedApplication.CreateBuilder(args);
var rabbitMQ = builder.AddRabbitMQ(AspireResourceNames.MessageBroker.ConnectionName)
.WithDataVolume()
.WithLifetime(ContainerLifetime.Persistent)
.WithManagementPlugin()
.WithDelayedMessageExchangePlugin();
Custom behaviours (optional)
You can pass a tag
argument to the WithDelayedMessageExchangePlugin
method if you like. This will force a particular version of the plugin to be installed (e.g. "3.0" or "4.0") rather than the default, which is "latest".
Troubleshooting
If I find and overcome any hurdles I'll mention them here, but it's early days. So far so good.
Contributing
I'm a hobbyist. I know there are loads of people out there who be able to improve this in ways I can't, or see opportunities for improvement that I can't even imagine. If you want to contribute, bring it on! Send me a pull request.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
-
net8.0
- Aspire.Hosting (>= 9.0.0)
- Aspire.Hosting.RabbitMQ (>= 9.0.0)
-
net9.0
- Aspire.Hosting (>= 9.0.0)
- Aspire.Hosting.RabbitMQ (>= 9.0.0)
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 |
---|---|---|
1.0.0 | 23 | 2/12/2025 |
First release