Shuttle.Esb 20.0.0

Prefix Reserved
Suggested Alternatives

Shuttle.Hopper

dotnet add package Shuttle.Esb --version 20.0.0
                    
NuGet\Install-Package Shuttle.Esb -Version 20.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="Shuttle.Esb" Version="20.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Shuttle.Esb" Version="20.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Shuttle.Esb" />
                    
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.Esb --version 20.0.0
                    
#r "nuget: Shuttle.Esb, 20.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 Shuttle.Esb@20.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=Shuttle.Esb&version=20.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Shuttle.Esb&version=20.0.0
                    
Install as a Cake Tool

Documentation

Please visit out official documentation for more information.

Getting Started

Start a new Console Application project. We'll need to install one of the support queue implementations. For this example we'll use Shuttle.Esb.AzureStorageQueues which can be hosted locally using Azurite:

PM> Install-Package Shuttle.Esb.AzureStorageQueues

We'll also make use of the .NET generic host:

PM> Install-Package Microsoft.Extensions.Hosting

Next we'll implement our endpoint in order to start listening on our queue:

internal class Program
{
    static async Task Main(string[] args)
    {
        await Host.CreateDefaultBuilder()
            .ConfigureServices(services =>
            {
                services
                    .AddServiceBus(builder =>
                    {
                        builder.Options.Inbox.WorkQueueUri = "azuresq://azure/work";

                        // Delegates may also be added to the builder, including adding dependencies
                        builder.AddMessageHandler(async (IHandlerContext<SomeMessage> context, ISomeDependency instance) =>
                        {
                            Console.WriteLine($@"[some-message] : guid = {context.Message.Guid}");

                            await Task.CompletedTask;
                        });
                    })
                    .AddAzureStorageQueues(builder =>
                    {
                        builder.AddOptions("azure", new AzureStorageQueueOptions
                        {
                            ConnectionString = "UseDevelopmentStorage=true;"
                        });
                    });
            })
            .Build()
            .RunAsync();
    }
}

Even though the options may be set directly as above, typically one would make use of a configuration provider:

internal class Program
{
    private static async Task Main(string[] args)
    {
        await Host.CreateDefaultBuilder()
            .ConfigureServices(services =>
            {
                var configuration =
                    new ConfigurationBuilder()
                        .AddJsonFile("appsettings.json")
                        .Build();

                services
                    .AddSingleton<IConfiguration>(configuration)
                    .AddServiceBus(builder =>
                    {
                        configuration
                            .GetSection(ServiceBusOptions.SectionName)
                            .Bind(builder.Options);
                    })
                    .AddAzureStorageQueues(builder =>
                    {
                        builder.AddOptions("azure", new AzureStorageQueueOptions
                        {
                            ConnectionString = configuration
                                .GetConnectionString("azure")
                        });
                    });
            })
            .Build()
            .RunAsync();
    }
}

The appsettings.json file would be as follows (remember to set to Copy always):

{
  "ConnectionStrings": {
    "azure": "UseDevelopmentStorage=true;"
  },
  "Shuttle": {
    "ServiceBus": {
      "Inbox": {
        "WorkQueueUri": "azuresq://azure/work",
      }
    }
  }
}

Send a command message for processing

await serviceBus.SendAsync(new RegisterMember
{
    UserName = "user-name",
    EMailAddress = "user@domain.com"
});

Publish an event message when something interesting happens

Before publishing an event one would need to register an ISubscrtiptionService implementation such as Shuttle.Esb.Sql.Subscription.

await serviceBus.PublishAsync(new MemberRegistered
{
    UserName = "user-name"
});

Subscribe to those interesting events

services.AddServiceBus(builder =>
{
    builder.AddSubscription<MemberRegistered>();
});

Handle any messages

public class RegisterMemberHandler : IMessageHandler<RegisterMember>
{
    public RegisterMemberHandler(IDependency dependency)
    {
    }

	public async Task ProcessMessageAsync(IHandlerContext<RegisterMember> context)
	{
        // perform member registration

		await context.PublishAsync(new MemberRegistered
		{
			UserName = context.Message.UserName
		});
	}
}
public class MemberRegisteredHandler : IMessageHandler<MemberRegistered>
{
	public async Task ProcessMessageAsync(IHandlerContext<MemberRegistered> context)
	{
        // processing
	}
}
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 (30)

Showing the top 5 NuGet packages that depend on Shuttle.Esb:

Package Downloads
Shuttle.Esb.RabbitMQ

RabbitMQ implementation for use with Shuttle.Esb.

Shuttle.Esb.Tests

Test fixtures to facilitate testing of components, such as queues, that relate to Shuttle.Esb.

Shuttle.Esb.Sql.Subscription

Sql-based implementation of ISubscriptionService interface for use with Shuttle.Esb implementations.

Shuttle.Esb.Process

Shuttle.Esb process management using Shuttle.Recall event sourcing.

Shuttle.Esb.FileMQ

File-based queue implementation for use with Shuttle.Esb.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
20.0.0 3,527 2/2/2025 20.0.0 is deprecated because it is no longer maintained.
15.0.0 2,181 8/5/2024 15.0.0 is deprecated because it is no longer maintained.
14.0.1 2,961 5/3/2024 14.0.1 is deprecated because it is no longer maintained.
14.0.0 1,223 4/30/2024 14.0.0 is deprecated because it is no longer maintained.
13.2.1 13,891 12/1/2022 13.2.1 is deprecated because it is no longer maintained.
13.2.0 10,216 9/16/2022 13.2.0 is deprecated because it is no longer maintained.
13.1.0 8,660 9/11/2022 13.1.0 is deprecated because it is no longer maintained.
13.0.0 8,612 9/4/2022 13.0.0 is deprecated because it is no longer maintained.
12.1.1 1,778 5/18/2022 12.1.1 is deprecated because it is no longer maintained.
12.1.0 1,585 5/18/2022 12.1.0 is deprecated because it is no longer maintained.
12.0.1 9,970 4/9/2022 12.0.1 is deprecated because it is no longer maintained.
12.0.0 9,066 3/21/2022 12.0.0 is deprecated because it is no longer maintained.
11.2.0 8,919 2/15/2021 11.2.0 is deprecated because it is no longer maintained.
11.1.1 1,795 2/9/2021 11.1.1 is deprecated because it is no longer maintained.
11.1.0 2,012 1/30/2021 11.1.0 is deprecated because it is no longer maintained.
11.0.3 13,645 1/17/2021 11.0.3 is deprecated because it is no longer maintained.
11.0.2 2,537 11/27/2020 11.0.2 is deprecated because it is no longer maintained.
11.0.1 24,517 7/31/2019 11.0.1 is deprecated because it is no longer maintained.
11.0.0 14,068 6/20/2019 11.0.0 is deprecated because it is no longer maintained.
10.1.8 3,193 12/26/2018 10.1.8 is deprecated because it is no longer maintained.
Loading failed