net10.0net8.0net9.0
An Aspire client integration for MassTransit RabbitMQ.
Published
Sep 30, 2026
19d ago
Total Downloads
86.8K
86,751
Install
dotnet add package CommunityToolkit.Aspire.MassTransit.RabbitMQ --version 13.6.0-beta.910
| Product | Versions |
|---|---|
| .NET |
README
MassTransit RabbitMQ Aspire Client Extension
Overview
This package provides an Aspire client extension for seamlessly integrating MassTransit with RabbitMQ. It works with the Aspire.Hosting.RabbitMQ.AddRabbitMQ() method for hosting.
The name string should match the name used in Aspire.Hosting.RabbitMQ.AddRabbitMQ(), as it references the connection string.
Features
- Configures MassTransit RabbitMQ integration for clients.
- Automatically discovers and registers consumers, sagas, and activities.
- Supports OpenTelemetry and Application Insights for monitoring.
- Uses the same configuration format as the hosting environment for easy integration.
- Multi-bus support to configure multiple RabbitMQ instances.
Usage
Installation
To install, add the extension to your client application using builder.Services in Startup.cs or Program.cs.
Example Usage
builder.AddMassTransitRabbitMq(
"rmq",
options => { options.DisableTelemetry = false; },
consumers =>
{
consumers.AddConsumer<SubmitOrderConsumer>();
consumers.AddConsumer<CancelOrderConsumer>();
consumers.AddConsumer<UpdateOrderConsumer>();
}
);
Multi-bus example
public interface ISecondBus : IBus;
builder.AddMassTransitRabbitMq("rabbitmq1", massTransitConfiguration: x =>
{
x.AddConsumer<TestConsumer>();
});
builder.AddMassTransitRabbitMq<ISecondBus>("rabbitmq2", massTransitConfiguration: x =>
{
x.AddConsumer<TestConsumerTwo>();
});
Changes from Previous Version
No structural changes between v13.5.1-beta.895 and v13.6.0-beta.910.
Adoption Assessment
A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.
This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 3 target frameworks; confirm the exact target used by your application.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.