Shuttle.Esb
20.0.0
Prefix Reserved
dotnet add package Shuttle.Esb --version 20.0.0
NuGet\Install-Package Shuttle.Esb -Version 20.0.0
<PackageReference Include="Shuttle.Esb" Version="20.0.0" />
paket add Shuttle.Esb --version 20.0.0
#r "nuget: Shuttle.Esb, 20.0.0"
// Install Shuttle.Esb as a Cake Addin #addin nuget:?package=Shuttle.Esb&version=20.0.0 // Install Shuttle.Esb as a Cake Tool #tool nuget:?package=Shuttle.Esb&version=20.0.0
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 | Versions 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. |
-
- Microsoft.Extensions.DependencyInjection (>= 8.0.1)
- Microsoft.Extensions.Hosting (>= 8.0.1)
- Shuttle.Core.Compression (>= 20.0.0)
- Shuttle.Core.Contract (>= 20.0.0)
- Shuttle.Core.Encryption (>= 20.0.0)
- Shuttle.Core.Pipelines (>= 20.0.0)
- Shuttle.Core.PipelineTransactionScope (>= 20.0.0)
- Shuttle.Core.Reflection (>= 20.0.0)
- Shuttle.Core.Serialization (>= 20.0.0)
- Shuttle.Core.Specification (>= 20.0.0)
- Shuttle.Core.Streams (>= 20.0.0)
- Shuttle.Core.System (>= 20.0.0)
- Shuttle.Core.Threading (>= 20.0.0)
- Shuttle.Core.TransactionScope (>= 20.0.0)
NuGet packages (31)
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.Process
Shuttle.Esb process management using Shuttle.Recall event sourcing. |
|
Shuttle.Esb.Msmq
MSMQ implementation for use with Shuttle.Esb. |
|
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 | 755 | 2/2/2025 |
15.0.0 | 1,411 | 8/5/2024 |
14.0.1 | 1,611 | 5/3/2024 |
14.0.0 | 715 | 4/30/2024 |
13.2.1 | 12,193 | 12/1/2022 |
13.2.0 | 9,484 | 9/16/2022 |
13.1.0 | 8,066 | 9/11/2022 |
13.0.0 | 7,982 | 9/4/2022 |
12.1.1 | 1,554 | 5/18/2022 |
12.1.0 | 1,369 | 5/18/2022 |
12.0.1 | 9,348 | 4/9/2022 |
12.0.0 | 8,482 | 3/21/2022 |
11.2.0 | 8,037 | 2/15/2021 |
11.1.1 | 1,563 | 2/9/2021 |
11.1.0 | 1,735 | 1/30/2021 |
11.0.3 | 12,546 | 1/17/2021 |
11.0.2 | 2,247 | 11/27/2020 |
11.0.1 | 20,355 | 7/31/2019 |
11.0.0 | 12,803 | 6/20/2019 |
10.1.8 | 2,922 | 12/26/2018 |
10.1.7 | 1,905 | 12/9/2018 |
10.1.6 | 39,769 | 10/15/2018 |
10.1.4 | 1,873 | 10/13/2018 |
10.1.2 | 4,075 | 10/6/2018 |
10.1.1 | 4,818 | 9/19/2018 |
10.1.0 | 2,364 | 9/17/2018 |
10.0.10 | 3,826 | 7/10/2018 |
10.0.9 | 2,270 | 7/8/2018 |
10.0.7 | 2,182 | 4/22/2018 |
10.0.6 | 2,954 | 4/12/2018 |
10.0.5 | 2,958 | 4/8/2018 |
10.0.3 | 8,613 | 2/13/2018 |
9.1.4 | 3,313 | 12/29/2017 |
9.1.3 | 2,174 | 10/22/2017 |
9.0.3 | 2,238 | 8/26/2017 |
9.0.2 | 3,774 | 8/6/2017 |
8.0.14 | 2,549 | 3/23/2018 |
8.0.13 | 4,830 | 12/29/2017 |
8.0.12 | 2,482 | 7/20/2017 |
8.0.11 | 2,208 | 7/17/2017 |
8.0.9 | 2,214 | 7/14/2017 |
8.0.8 | 2,812 | 7/6/2017 |
8.0.7 | 6,005 | 5/15/2017 |
8.0.5 | 2,460 | 5/7/2017 |
8.0.4 | 2,190 | 5/6/2017 |
8.0.3 | 2,444 | 5/6/2017 |
8.0.1 | 2,386 | 4/23/2017 |
8.0.0 | 8,165 | 3/24/2017 |
7.0.4 | 3,444 | 10/26/2016 |
7.0.3 | 2,972 | 10/4/2016 |
7.0.1 | 3,054 | 9/19/2016 |
7.0.0 | 2,382 | 9/4/2016 |
6.2.1 | 2,693 | 7/26/2016 |
6.2.0 | 2,996 | 7/23/2016 |
6.1.3 | 2,564 | 6/6/2016 |
6.1.2 | 2,293 | 6/4/2016 |
6.1.1 | 6,617 | 6/4/2016 |
6.1.0 | 2,885 | 6/4/2016 |
6.0.0 | 7,767 | 4/24/2016 |
5.1.9 | 5,444 | 4/3/2016 |
5.1.6 | 7,916 | 3/21/2016 |