Swevo.AutoBus.RabbitMQ 1.0.0

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Swevo.AutoBus.RabbitMQ --version 1.0.0
                    
NuGet\Install-Package Swevo.AutoBus.RabbitMQ -Version 1.0.0
                    
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="Swevo.AutoBus.RabbitMQ" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Swevo.AutoBus.RabbitMQ" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Swevo.AutoBus.RabbitMQ" />
                    
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 Swevo.AutoBus.RabbitMQ --version 1.0.0
                    
#r "nuget: Swevo.AutoBus.RabbitMQ, 1.0.0"
                    
#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 Swevo.AutoBus.RabbitMQ@1.0.0
                    
#: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=Swevo.AutoBus.RabbitMQ&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Swevo.AutoBus.RabbitMQ&version=1.0.0
                    
Install as a Cake Tool

AutoBus

NuGet NuGet Downloads CI License: MIT

Free, MIT-licensed message bus for .NET. No commercial license required — ever.

Why AutoBus?

MassTransit v9 is now a commercial product. AutoBus is a much smaller, focused alternative for the common case: a modular monolith (or a small set of services) that wants reliable pub/sub and point-to-point messaging with retry, without adopting a paid distributed messaging framework. It isn't a drop-in MassTransit replacement — there's no saga state machine engine, no routing slips, no multi-broker rider abstraction — just consumers, publish/send, retry, and (optionally) RabbitMQ.

public sealed class OrderCreated
{
    public int OrderId { get; init; }
}

public sealed class SendWelcomeEmail : IConsumer<OrderCreated>
{
    public Task Consume(ConsumeContext<OrderCreated> context)
    {
        // send the email...
        return Task.CompletedTask;
    }
}

services.AddAutoBus(cfg => cfg.AddConsumer<SendWelcomeEmail>());

// elsewhere:
await messageBus.PublishAsync(new OrderCreated { OrderId = 42 });

Install

dotnet add package Swevo.AutoBus

For cross-process messaging over RabbitMQ:

dotnet add package Swevo.AutoBus.RabbitMQ

Core concepts

  • IConsumer<TMessage> — implement this for each message type you handle.
  • IMessageBus.PublishAsync — fan-out to every registered consumer for a message type (zero consumers is not an error).
  • IMessageBus.SendAsync — point-to-point; throws if zero or more than one consumer is registered for the message type.
  • Retry — every consumer invocation runs through a Polly retry pipeline (exponential backoff, 3 attempts by default). Configure with cfg.UseRetry(retryCount, baseDelay).
  • TransportsInMemoryTransport (default, in-process dispatch) or RabbitMqTransport/RabbitMqConsumerHost (cross-process, via Swevo.AutoBus.RabbitMQ).

RabbitMQ transport

services.AddAutoBus(cfg => cfg.AddConsumer<SendWelcomeEmail>());
services.AddAutoBusRabbitMq(options =>
{
    options.HostName = "localhost";
    options.QueuePrefix = "orders-service"; // scopes queue names per service
});

Publishing a message sends it to a fanout exchange named after the message's full type name. AddAutoBusRabbitMq also registers a hosted RabbitMqConsumerHost that declares and binds a durable queue for every locally-registered consumer, so the same IConsumer<T> code runs whether messages arrive in-process or over the broker — call AddAutoBusRabbitMq after AddAutoBus since it replaces the default in-memory transport.

Using AutoBus from an EF Core transactional outbox

AutoBus's IMessageBus.PublishAsync(object message, Type messageType, CancellationToken) overload mirrors MassTransit's IPublishEndpoint.Publish(object, Type, CancellationToken) signature, so it's a drop-in replacement inside an outbox processor loop — see EFCore.Outbox, which uses AutoBus instead of MassTransit for exactly this reason.

Design goals

  • MIT licensed, forever. No commercial tier, no per-seat fees.
  • Small surface area. Consumers, publish/send, retry — no bespoke DSL to learn.
  • Same code, two transports. Consumers are written once; swapping InMemoryTransport for RabbitMqTransport is a one-line DI change.

Roadmap

  • Saga/state-machine support and additional broker transports (Azure Service Bus, Amazon SQS) are being considered for future releases, scoped to real demand rather than parity with MassTransit's full feature set.

💼 Need .NET consulting?

I'm the author of AutoBus and a suite of compile-time source generators (AutoWire, AutoMap.Generator) and 28+ Polly v8 resilience packages. I'm available for consulting on Polly v8 resilience, Azure cloud architecture, and clean .NET design.

→ solidqualitysolutions.com · LinkedIn

Also by the same author

🌐 Full suite overview: swevo.github.io

Package Description
EFCore.Outbox Transactional outbox pattern for EF Core — pairs naturally with AutoBus.
Swevo.AutoAssert Free, MIT-licensed fluent assertions — alternative to FluentAssertions' commercial license.
EFCore.BulkOperations Free, MIT-licensed bulk insert/update/delete for EF Core.
AutoWire Compile-time DI auto-registration — [Scoped]/[Singleton]/[Transient] generates IServiceCollection registration code.
AutoDispatch.Generator Compile-time CQRS dispatcher — free alternative to MediatR's commercial license.

License

MIT © Justin Bannister

Product 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 was computed.  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.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows 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
1.1.0 108 7/10/2026
1.0.1 100 7/7/2026
1.0.0 106 7/7/2026

1.0.0: Initial release. RabbitMqTransport (publish) + RabbitMqConsumerHost (receive/dispatch).