MinGo.Messaging.Core
0.0.5
dotnet add package MinGo.Messaging.Core --version 0.0.5
NuGet\Install-Package MinGo.Messaging.Core -Version 0.0.5
<PackageReference Include="MinGo.Messaging.Core" Version="0.0.5" />
<PackageVersion Include="MinGo.Messaging.Core" Version="0.0.5" />
<PackageReference Include="MinGo.Messaging.Core" />
paket add MinGo.Messaging.Core --version 0.0.5
#r "nuget: MinGo.Messaging.Core, 0.0.5"
#:package MinGo.Messaging.Core@0.0.5
#addin nuget:?package=MinGo.Messaging.Core&version=0.0.5
#tool nuget:?package=MinGo.Messaging.Core&version=0.0.5
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) |
| InMemory | MinGo.Messaging.InMemory |
Process-local, zero-dependency transport for unit tests and local development |
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) vsBroadcast(all instances) - Named Messaging Endpoints: Publisher routing via Keyed DI
- Explicit Integration Registration:
UseRabbitMQ()/UseSimpleMessageBroker()/UseInMemory()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
AssemblyNamefilters
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() / .UseInMemory()
.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/AddConsumerso their transports are available. Any explicit registration (orAddIntegrations(...)) 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
AssemblyNamebefore 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.
AssemblyFiltersships ready-made predicates:NamePrefix,NameEquals,NameContains,NameMatches. A plainname => ...lambda works just as well.- The parameterless
AddPublishers()and explicitAddConsumer(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 | 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. 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. |
-
net8.0
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.2)
- Microsoft.Extensions.DependencyInjection (>= 8.0.1)
- Microsoft.Extensions.DependencyModel (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Options (>= 8.0.2)
- MinGo.Messaging.Abstractions (>= 0.0.5)
- System.Text.Json (>= 8.0.5)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on MinGo.Messaging.Core:
| Package | Downloads |
|---|---|
|
MinGo.Messaging.Hosting
IHostedService lifecycle management for MinGo.Messaging. |
|
|
MinGo.Messaging.RabbitMQ
RabbitMQ transport integration for MinGo.Messaging with Competing and Broadcast delivery modes. |
|
|
MinGo.Messaging.SimpleMessageBroker
SimpleMessageBroker transport integration for MinGo.Messaging. Uses the SimpleMessageBroker.Client SDK over JSON over HTTP. |
|
|
MinGo.Messaging.InMemory
In-process, zero-dependency transport integration for MinGo.Messaging. Intended for unit tests, local development, and single-process workloads. |
GitHub repositories
This package is not used by any popular GitHub repositories.