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
<PackageReference Include="ResQ.BuildingBlocks.Adapters.Messaging" Version="0.2.0" />
<PackageVersion Include="ResQ.BuildingBlocks.Adapters.Messaging" Version="0.2.0" />
<PackageReference Include="ResQ.BuildingBlocks.Adapters.Messaging" />
paket add ResQ.BuildingBlocks.Adapters.Messaging --version 0.2.0
#r "nuget: ResQ.BuildingBlocks.Adapters.Messaging, 0.2.0"
#:package ResQ.BuildingBlocks.Adapters.Messaging@0.2.0
#addin nuget:?package=ResQ.BuildingBlocks.Adapters.Messaging&version=0.2.0
#tool nuget:?package=ResQ.BuildingBlocks.Adapters.Messaging&version=0.2.0
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 customJsonSerializerOptions. - Transport contracts:
MessageEnvelope(the wire record) andIMessageSource(read / acknowledge / nack). - Default transport:
ChannelMessageBroker— an unbounded channel that is bothIIntegrationEventPublisher(write) andIMessageSource(read). Nacks re-enqueue. - Typed dispatch:
IIntegrationEventHandler<TEvent>+IntegrationEventDispatcher— resolves the CLR type viaDictionaryIntegrationEventTypeRegistry, 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 PollyResiliencePipelineretry built fromRetryOptions, dead-letter on exhaustion, and in-flight draining on shutdown. Configured viaConsumerOptions. - Reliability:
RetryOptions,IDeadLetterSink(+LoggingDeadLetterSinkdefault,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 | 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 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. |
-
net8.0
- FluentValidation (>= 11.11.0)
- FluentValidation.DependencyInjectionExtensions (>= 11.11.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Options (>= 9.0.0)
- Polly.Core (>= 8.5.0)
- ResQ.BuildingBlocks.Application (>= 0.2.0)
- ResQ.BuildingBlocks.Domain (>= 0.2.0)
- Scrutor (>= 5.0.1)
- System.Text.Json (>= 9.0.19)
-
net9.0
- FluentValidation (>= 11.11.0)
- FluentValidation.DependencyInjectionExtensions (>= 11.11.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Options (>= 9.0.0)
- Polly.Core (>= 8.5.0)
- ResQ.BuildingBlocks.Application (>= 0.2.0)
- ResQ.BuildingBlocks.Domain (>= 0.2.0)
- Scrutor (>= 5.0.1)
- System.Text.Json (>= 9.0.19)
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 |