MinGo.Messaging.SimpleMessageBroker 0.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package MinGo.Messaging.SimpleMessageBroker --version 0.0.3
                    
NuGet\Install-Package MinGo.Messaging.SimpleMessageBroker -Version 0.0.3
                    
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="MinGo.Messaging.SimpleMessageBroker" Version="0.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MinGo.Messaging.SimpleMessageBroker" Version="0.0.3" />
                    
Directory.Packages.props
<PackageReference Include="MinGo.Messaging.SimpleMessageBroker" />
                    
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 MinGo.Messaging.SimpleMessageBroker --version 0.0.3
                    
#r "nuget: MinGo.Messaging.SimpleMessageBroker, 0.0.3"
                    
#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 MinGo.Messaging.SimpleMessageBroker@0.0.3
                    
#: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=MinGo.Messaging.SimpleMessageBroker&version=0.0.3
                    
Install as a Cake Addin
#tool nuget:?package=MinGo.Messaging.SimpleMessageBroker&version=0.0.3
                    
Install as a Cake Tool

MinGo.Messaging

A business-oriented, runtime-middleware-agnostic messaging SDK for .NET 8+.

Architecture

Three-layer design: Base SDK → Integration SDK → Middleware Client

Layer Package Responsibility
Abstractions MinGo.Messaging.Abstractions Contract models, SPI interfaces, Subscription domain model
Core MinGo.Messaging.Core Auto-discovery, Keyed DI, consumer pipeline, named publishers
Hosting MinGo.Messaging.Hosting IHostedService lifecycle management
RabbitMQ MinGo.Messaging.RabbitMQ RabbitMQ transport with Competing/Broadcast delivery modes
SimpleMessageBroker MinGo.Messaging.SimpleMessageBroker SimpleMessageBroker transport (pull-based consumption, JSON over HTTP)

Key Concepts

  • Contract-First: [MessageContract] attribute defines message identity
  • Subscription as First-Class Entity: Business fan-out separated from runtime topology
  • Two-Layer Fan-out: Event → Subscriptions (business) → Consumer Instances (scale)
  • DeliveryMode: Competing (load balance) vs Broadcast (all instances)
  • Named Messaging Endpoints: Publisher routing via Keyed DI
  • Explicit Integration Registration: UseRabbitMQ() / UseSimpleMessageBroker() wire a known integration directly — no assembly scanning, AOT/trimming-friendly
  • Convention-Driven Auto-Assembly: [MessagingIntegration] for zero-config integration discovery
  • Filter-Based Assembly Scanning: discover integrations/consumers/publishers across the whole dependency graph, narrowed by AssemblyName filters

Quick Start

var builder = Host.CreateApplicationBuilder(args);

builder.Services.AddMessaging(builder.Configuration)
    // Register the integration explicitly — no assembly scanning required.
    .UseRabbitMQ()
    // Publishers and consumers are still discovered by convention.
    .AddPublishers()
    .AddConsumer(typeof(Program).Assembly);

builder.AddMessagingHost();

var host = builder.Build();
host.Run();

Registering Integrations

An integration provides a transport (and its keyed IMessagePublisher). Register one either explicitly or by scanning; both paths bind the same options from Messaging:Integrations:{Name} and are behaviourally identical.

Explicit (recommended — AOT/trimming-friendly, no reflection over the dependency graph):

builder.Services.AddMessaging(configuration)
    .UseRabbitMQ()                 // or .UseSimpleMessageBroker()
    .AddPublishers()
    .AddConsumer(typeof(Program).Assembly);

Each integration SDK ships a Use{X}() extension. Under the hood it invokes the SDK's own Configure hook (binding options / registering client services) and then the Core primitive AddIntegration<TTransport>(name), which registers only the keyed transport + publisher. Call that primitive directly for a custom transport:

.AddIntegration<MyCustomTransport>("MyIntegration")

Scanning (convention-driven, zero wiring): AddIntegrations finds every assembly in the dependency graph carrying [MessagingIntegration], optionally narrowed by a filter:

builder.Services.AddMessaging(configuration)
    .AddIntegrations(AssemblyFilters.NamePrefix("MinGo.Messaging."))
    .AddPublishers()
    .AddConsumer(typeof(Program).Assembly);

Register the integration before AddPublishers / AddConsumer so their transports are available. Any explicit registration (or AddIntegrations(...)) claims integration discovery, so the implicit whole-graph scan will not also run.

Assembly Scanning

Discovery walks the entire application dependency graph (DependencyContext), so assemblies that are referenced but not yet loaded are still found. This fixes the classic problem where a consumer or typed publisher declared in a referenced library is never registered because .NET loads assemblies lazily.

Each AddIntegrations / AddPublishers / AddConsumer accepts an optional Func<AssemblyName, bool> filter:

  • Filters are evaluated against the AssemblyName before loading, so only matching assemblies are loaded and inspected — no more loading the entire dependency closure.
  • No filter → the whole dependency graph is scanned (the broadest, backward-compatible default).
  • Repeated calls combine as a union and results are de-duplicated.
  • AssemblyFilters ships ready-made predicates: NamePrefix, NameEquals, NameContains, NameMatches. A plain name => ... lambda works just as well.
  • The parameterless AddPublishers() and explicit AddConsumer(Assembly) forms remain supported.
builder.Services.AddMessaging(configuration)
    .AddIntegrations(name => name.Name!.StartsWith("MinGo.Messaging."))
    .AddConsumer(typeof(MyHandler).Assembly);   // explicit assembly still works

License

MIT

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

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
0.0.5 90 9/19/2026
0.0.4 109 9/6/2026
0.0.3 111 9/5/2026