EventFlux.RabbitFlow 1.0.1

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

EventFlux.RabbitFlow

EventFlux.RabbitFlow is a lightweight event-driven library that integrates with RabbitMQ, providing an efficient way to handle event-based messaging in .NET applications.

Features
  • Seamless integration with RabbitMQ
  • Supports event-driven CQRS patterns
  • Easy event publishing and subscription
  • Automatic dependency injection support

Installation

To install EventFlux.RabbitFlow, use NuGet Package Manager:

Install-Package EventFlux.RabbitFlow

Quick Start

To install EventFlux.RabbitFlow, use NuGet Package Manager:

1. Define an Event
Create an event that implements IEventRequest:
public class ExampleEventRequest : IEventRequest
{
    public string Str { get; set; }
}
2. Create an Event Handler
Implement the IEventHandler<T> interface to handle the event:
public class ExampleEventRequestHandler : IEventHandler<ExampleEventRequest>
{
    public async Task Handle(ExampleEventRequest @event)
    {
        Console.WriteLine("Consume data: " + @event.Str);
    }
}
3. Configure Dependency Injection
Register the library and RabbitMQ connection in Program.cs:
builder.Services.AddEventFluxRabbitFlow(typeof(Program).Assembly, new ConnectionFactory()
{
    Uri = new Uri("amqp://guest:guest@localhost:5672")
}, "publisher_queue");
4. Subscribe to Events
Resolve IEventBroker and subscribe to events:
var _sp = builder.Services.BuildServiceProvider();
var _eventBus = _sp.GetRequiredService<EventFlux.RabbitFlow.Abstractions.IEventBroker>();
await _eventBus.SubscribeAsync<ExampleEventRequest, ExampleEventRequestHandler>();
5. Publish an Event
In your API controller, publish an event:
[HttpPost]
public async Task<IActionResult> Post()
{
    ExampleEventRequest @event = new ExampleEventRequest { Str = "Hello World" };
    await _eventBus.PublishAsync(@event);
    return Ok();
}
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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 463 3/25/2025

- Improved integration with RabbitMQ for better message handling.
- Enhanced event-driven CQRS support with optimized event persistence.