Shuttle.Hopper
21.0.1-rc3
Prefix Reserved
See the version list below for details.
dotnet add package Shuttle.Hopper --version 21.0.1-rc3
NuGet\Install-Package Shuttle.Hopper -Version 21.0.1-rc3
<PackageReference Include="Shuttle.Hopper" Version="21.0.1-rc3" />
<PackageVersion Include="Shuttle.Hopper" Version="21.0.1-rc3" />
<PackageReference Include="Shuttle.Hopper" />
paket add Shuttle.Hopper --version 21.0.1-rc3
#r "nuget: Shuttle.Hopper, 21.0.1-rc3"
#:package Shuttle.Hopper@21.0.1-rc3
#addin nuget:?package=Shuttle.Hopper&version=21.0.1-rc3&prerelease
#tool nuget:?package=Shuttle.Hopper&version=21.0.1-rc3&prerelease
Shuttle.Hopper
Shuttle.Hopper is a comprehensive message bus implementation that facilitates message-driven communication between different components of an application. It provides a robust and flexible architecture for building distributed systems.
Installation
dotnet add package Shuttle.Hopper
Registration
To use Shuttle.Hopper, you need to register it with your service collection:
services.AddHopper(options =>
{
// Configure Hopper options here
});
The AddHopper method returns a HopperBuilder that can be used to further configure the bus, such as adding message handlers and subscriptions.
Messaging Operations
The core interface for sending and publishing messages is IBus.
IBus
You can use IBus to send commands or publish events:
// Sending a command
await bus.SendAsync(new MyCommand { Value = "Hello" });
// Publishing an event
await bus.PublishAsync(new MyEvent { OccurredAt = DateTime.Now });
Message Handlers
Shuttle.Hopper supports two types of message handlers:
IContextMessageHandler<T>
This handler receives an IHandlerContext<T> providing access to message metadata and the ability to send or publish messages within the handler context.
public class MyContextHandler : IContextMessageHandler<MyMessage>
{
public async Task HandleAsync(IHandlerContext<MyMessage> context, CancellationToken cancellationToken = default)
{
// Handle the message
var message = context.Message;
// Use the context to send another message
await context.SendAsync(new AnotherMessage());
}
}
IMessageHandler<T>
This handler receives the message directly, which is useful for simpler handling scenarios.
public class MySimpleHandler : IMessageHandler<MyMessage>
{
public async Task HandleAsync(MyMessage message, CancellationToken cancellationToken = default)
{
// Handle the message
Console.WriteLine(message.Value);
}
}
Registering Message Handlers
Message handlers can be registered using the HopperBuilder:
services.AddHopper(options => { ... })
.AddMessageHandler<MyContextHandler>()
.AddMessageHandler<MySimpleHandler>()
.AddMessageHandlersFrom(typeof(MyContextHandler).Assembly);
Subscriptions
You can add subscriptions to the bus using the HopperBuilder:
services.AddHopper(options => { ... })
.AddSubscription<MyEvent>();
Bus Control
The IBusControl interface is used to start and stop the bus. By default, the bus starts automatically when the application starts if the AutoStart option is set to true (which is the default).
IBusControl
public interface IBusControl : IDisposable, IAsyncDisposable
{
bool Started { get; }
Task<IBusControl> StartAsync(CancellationToken cancellationToken = default);
Task StopAsync(CancellationToken cancellationToken = default);
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Microsoft.Extensions.Caching.Memory (>= 10.0.5)
- Microsoft.Extensions.DependencyInjection (>= 10.0.5)
- Microsoft.Extensions.Hosting (>= 10.0.5)
- Shuttle.Contract (>= 21.0.1-rc3)
- Shuttle.Pipelines (>= 21.0.1-rc3)
- Shuttle.Platform (>= 21.0.1-rc3)
- Shuttle.Reflection (>= 21.0.1-rc3)
- Shuttle.Serialization (>= 21.0.1-rc3)
- Shuttle.Specification (>= 21.0.1-rc3)
- Shuttle.Streams (>= 21.0.1-rc3)
- Shuttle.Threading (>= 21.0.1-rc3)
NuGet packages (9)
Showing the top 5 NuGet packages that depend on Shuttle.Hopper:
| Package | Downloads |
|---|---|
|
Shuttle.Access.Application
Application concern implementations such as Shuttle.Mediator participants. |
|
|
Shuttle.Hopper.AzureStorageQueues
Azure Storage Queue implementation for use with Shuttle.Hopper. |
|
|
Shuttle.Hopper.AmazonSqs
Amazon Simple Queue Service implementation for use with Shuttle.Hopper. |
|
|
Shuttle.Hopper.RabbitMQ
RabbitMQ implementation for use with Shuttle.Hopper. |
|
|
Shuttle.Hopper.AzureEventHubs
Azure Event Hubs implementation for use with Shuttle.Hopper. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 21.0.2 | 544 | 4/17/2026 |
| 21.0.1 | 179 | 4/15/2026 |
| 21.0.1-rc3 | 261 | 4/11/2026 |
| 21.0.1-rc2 | 218 | 3/21/2026 |
| 21.0.1-rc1 | 198 | 2/28/2026 |
| 21.0.1-beta | 200 | 2/7/2026 |
| 21.0.0-alpha | 175 | 1/18/2026 |