Making.Events.RabbitMQ 1.0.1-preview

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

Making.Events.RabbitMQ

RabbitMQ event bus implementation for the Making framework.

Overview

Making.Events.RabbitMQ provides a distributed event bus implementation using RabbitMQ for the Making framework. It enables event-driven communication across microservices and distributed applications with reliable message delivery and persistence.

Features

  • Distributed Event Bus: RabbitMQ-based event bus for cross-service communication
  • Reliable Messaging: Persistent queues and acknowledgments
  • Dead Letter Queues: Handle failed message processing
  • Exchange Management: Automatic exchange and queue setup
  • Serialization: JSON-based event serialization
  • Connection Management: Resilient connection handling with retry logic

Installation

dotnet add package Making.Events.RabbitMQ

Usage

Configuration

{
  "RabbitMQ": {
    "ConnectionString": "amqp://guest:guest@localhost:5672/",
    "ExchangeName": "mark.events",
    "QueueName": "mark.events.queue",
    "RetryCount": 3,
    "RetryDelayMs": 1000
  }
}

Register Services

services.AddMakingRabbitMQEvents(configuration);

Define Events

public class OrderCreatedEvent : IEvent
{
    public string OrderId { get; set; }
    public string CustomerId { get; set; }
    public decimal TotalAmount { get; set; }
    public DateTime CreatedAt { get; set; }
}

Event Handlers

public class OrderCreatedEventHandler : IEventHandler<OrderCreatedEvent>
{
    public async Task HandleAsync(OrderCreatedEvent @event)
    {
        // Process order created event
        Console.WriteLine($"Processing order {@event.OrderId} for customer {@event.CustomerId}");
        
        // Send confirmation email, update inventory, etc.
    }
}

Publishing Events

public class OrderService
{
    private readonly IEventBus _eventBus;
    
    public OrderService(IEventBus eventBus)
    {
        _eventBus = eventBus;
    }
    
    public async Task CreateOrderAsync(Order order)
    {
        // Create order logic...
        
        // Publish event to RabbitMQ
        await _eventBus.PublishAsync(new OrderCreatedEvent
        {
            OrderId = order.Id,
            CustomerId = order.CustomerId,
            TotalAmount = order.TotalAmount,
            CreatedAt = DateTime.UtcNow
        });
    }
}

Subscribing to Events

public class InventoryService
{
    private readonly IEventBus _eventBus;
    
    public InventoryService(IEventBus eventBus)
    {
        _eventBus = eventBus;
    }
    
    public async Task SubscribeToOrderEvents()
    {
        await _eventBus.SubscribeAsync<OrderCreatedEvent>(async @event =>
        {
            // Update inventory when order is created
            await UpdateInventoryAsync(@event.OrderId);
        });
    }
}

Requirements

  • .NET Standard 2.0+
  • RabbitMQ Server
  • RabbitMQ.Client
  • Microsoft.Extensions.DependencyInjection
  • Microsoft.Extensions.Hosting
  • System.Text.Json
  • Making.Events
  • Making.RabbitMQ

License

This project is part of the Making framework.

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 is compatible.  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

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-preview 317 7/25/2025
1.0.0-preview 391 7/25/2025