OpenSleigh.Transport.RabbitMQ 2.0.2

.NET 6.0
NuGet\Install-Package OpenSleigh.Transport.RabbitMQ -Version 2.0.2
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.
dotnet add package OpenSleigh.Transport.RabbitMQ --version 2.0.2
<PackageReference Include="OpenSleigh.Transport.RabbitMQ" Version="2.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add OpenSleigh.Transport.RabbitMQ --version 2.0.2
#r "nuget: OpenSleigh.Transport.RabbitMQ, 2.0.2"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install OpenSleigh.Transport.RabbitMQ as a Cake Addin
#addin nuget:?package=OpenSleigh.Transport.RabbitMQ&version=2.0.2

// Install OpenSleigh.Transport.RabbitMQ as a Cake Tool
#tool nuget:?package=OpenSleigh.Transport.RabbitMQ&version=2.0.2

OpenSleigh.Transport.RabbitMQ

Nuget

Description

RabbitMQ Transport library for OpenSleigh

Installation

This library can be installed from Nuget: https://www.nuget.org/packages/OpenSleigh.Transport.RabbitMQ/

How-to

The first thing to do is build an instance of RabbitConfiguration with the connection details. This can be done by reading the current app configuration. Once done, all you have to do is to call the UseRabbitMQTransport extension method:

services.AddOpenSleigh(cfg =>{     
    var rabbitSection = Configuration.GetSection("Rabbit");
    var rabbitCfg = new RabbitConfiguration(rabbitSection["HostName"],
        rabbitSection["UserName"],
        rabbitSection["Password"]);

        cfg.UseRabbitMQTransport(rabbitCfg);

    // register the Persistence and the Sagas
});

It is also possible to use a custom naming policy to define the names for exchanges and queues. This allows us to have a single exchange bound to multiple queues. Messages will be routed using the queue name.

services.AddOpenSleigh(cfg =>{  
    // code omitted
    cfg.UseRabbitMQTransport(rabbitCfg, builder =>
    {                        
        builder.UseMessageNamingPolicy<StartChildSaga>(() => new QueueReferences("child", "child.start", "child.dead", "child.dead.start"));
        builder.UseMessageNamingPolicy<ProcessChildSaga>(() => new QueueReferences("child", "child.process", "child.dead", "child.dead.process"));
    })
});

If your application has to handle messages and events, not just dispatch them, you also have to configure each Saga :

services.AddOpenSleigh(cfg =>{  
    // code omitted //

    cfg.AddSaga<MySaga, MySagaState>()
        .UseStateFactory<StartSaga>(msg => new MySagaState(msg.CorrelationId))
        .UseRabbitMQTransport();
});

Do you like this project? Then consider giving a donation! Donate

Product Versions
.NET net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on OpenSleigh.Transport.RabbitMQ:

Repository Stars
mizrael/OpenSleigh
OpenSleigh is a Saga management library for .NET Core.
Version Downloads Last updated
2.0.2 62 8/30/2022
2.0.1 166 1/3/2022
2.0.0 131 12/30/2021
1.4.4 205 11/14/2021
1.4.3 133 11/12/2021
1.4.2 221 11/8/2021
1.4.1 174 11/5/2021
1.4.0 415 8/27/2021
1.3.0 240 4/29/2021
1.2.1 179 4/26/2021
1.2.0 160 3/30/2021
1.1.0 173 3/27/2021
1.0.2 217 3/24/2021
1.0.1 255 3/11/2021
1.0.0 272 2/15/2021
0.9.2 250 2/9/2021
0.9.1 262 1/31/2021
0.9.0 194 1/27/2021
0.8.0 241 1/19/2021
0.7.0 171 1/14/2021
0.6.0 208 1/11/2021
0.5.1 219 1/8/2021
0.5.0 230 1/8/2021
0.4.0 222 1/7/2021
0.3.0 187 1/5/2021
0.2.0 259 1/3/2021
0.1.0 189 12/31/2020
0.0.1 197 12/31/2020