Shuttle.Hopper 21.0.1-rc3

Prefix Reserved
This is a prerelease version of Shuttle.Hopper.
There is a newer version of this package available.
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
                    
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="Shuttle.Hopper" Version="21.0.1-rc3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Shuttle.Hopper" Version="21.0.1-rc3" />
                    
Directory.Packages.props
<PackageReference Include="Shuttle.Hopper" />
                    
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 Shuttle.Hopper --version 21.0.1-rc3
                    
#r "nuget: Shuttle.Hopper, 21.0.1-rc3"
                    
#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 Shuttle.Hopper@21.0.1-rc3
                    
#: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=Shuttle.Hopper&version=21.0.1-rc3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Shuttle.Hopper&version=21.0.1-rc3&prerelease
                    
Install as a Cake Tool

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

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