ResQ.BuildingBlocks.Adapters.Messaging 0.2.0

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

ResQ.BuildingBlocks.Adapters.Messaging

A broker-agnostic messaging adapter (driven ring) that implements the integration-event ports owned by ResQ.BuildingBlocks.Application and adds the transport, serialization, and consumer machinery. It ships no broker client — the default transport is an in-memory System.Threading.Channels loopback, so a service is publish/consume-capable from minute one and can swap in a real broker later without touching call sites.

Depends only on ResQ.BuildingBlocks.Application + ResQ.BuildingBlocks.Domain.

What's in the box

  • Serialization: SystemTextJsonMessageSerializer (IMessageSerializer) — UTF-8 JSON, web defaults, optional custom JsonSerializerOptions.
  • Transport contracts: MessageEnvelope (the wire record) and IMessageSource (read / acknowledge / nack).
  • Default transport: ChannelMessageBroker — an unbounded channel that is both IIntegrationEventPublisher (write) and IMessageSource (read). Nacks re-enqueue.
  • Typed dispatch: IIntegrationEventHandler<TEvent> + IntegrationEventDispatcher — resolves the CLR type via DictionaryIntegrationEventTypeRegistry, deserializes, and fans out to every handler in the current scope (reflection cached per type).
  • Consumer: MessageConsumerService (BackgroundService) — concurrency-bounded (SemaphoreSlim), idempotency short-circuit, a Polly ResiliencePipeline retry built from RetryOptions, dead-letter on exhaustion, and in-flight draining on shutdown. Configured via ConsumerOptions.
  • Reliability: RetryOptions, IDeadLetterSink (+ LoggingDeadLetterSink default, NullDeadLetterSink).
  • Opt-outs: NullIdempotencyStore (always "not processed"), NullIntegrationEventPublisher (discards).

Wiring

services.AddResqMessaging(
    b => b.UseInMemory(),          // publisher + source = ChannelMessageBroker
    typeof(SomethingHappened).Assembly);  // scans IntegrationEvent subtypes + handlers

AddResqMessaging registers the serializer, a registry populated from the scanned assemblies, the dispatcher, the discovered IIntegrationEventHandler<> implementations (scoped), and the default NullIdempotencyStore + LoggingDeadLetterSink. Swap components with UsePublisher<T>(), AddMessageSource<TSource>() (or AddKeyedMessageSource<TSource>(key) to bind distinct sources to distinct consumers), and UseDeadLetterSink<T>().

To run a consumer, subclass MessageConsumerService and register it as a hosted service; the subclass name is the idempotency handler key. A durable idempotency store (e.g. the EF inbox from Adapters.Persistence) or dead-letter sink registered elsewhere is honored automatically.

The dead-letter / retry-with-jitter / idempotency stack is exercised through the in-memory transport until a real broker adapter (e.g. Kafka) lands.

Apache-2.0 · part of resq-software/dotnet.

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
0.2.0 463 8/16/2026