This repository is SlimMessageBus, a .NET message bus library.
GitHub repository: https://github.com/zarusz/SlimMessageBus
src/SlimMessageBuscontains the core public interfaces and contracts, such asIMessageBus,IPublishBus,IRequestResponseBus,IConsumer<TMessage>,IRequestHandler<TRequest, TResponse>, and request marker types.src/SlimMessageBus.Hostcontains the main hosting/runtime implementation used with .NET Generic Host and Microsoft dependency injection. It wires bus configuration, producers, consumers, request/response, message scopes, serialization hooks, and lifecycle control.src/SlimMessageBus.Host.Configuration,src/SlimMessageBus.Host.Interceptor, and relatedSlimMessageBus.Host.*projects add host-level configuration, interceptors, validation, circuit breakers, outbox support, serialization, and other extension points.- Transport and feature plugins live in
src/SlimMessageBus.Host.*, for exampleSlimMessageBus.Host.Kafka,SlimMessageBus.Host.AzureServiceBus,SlimMessageBus.Host.RabbitMQ,SlimMessageBus.Host.AmazonSQS,SlimMessageBus.Host.Memory,SlimMessageBus.Host.Redis,SlimMessageBus.Host.Nats,SlimMessageBus.Host.Mqtt, andSlimMessageBus.Host.Sql. src/Samplescontains sample applications and usage examples.- Tests live under
src/Tests, usually matching the package or plugin being tested.
- Applications configure the bus via
services.AddSlimMessageBus(mbb => { ... }). MessageBusBuilderdeclarations describe produced and consumed message types, paths such as topics or queues, transport provider settings, request/response settings, serializers, and additional plugins.- Producers use
IMessageBus/IPublishBusto publish messages andIRequestResponseBusfor request/response. - Consumers implement
IConsumer<TMessage>for pub/sub or queue consumption. - Request handlers implement
IRequestHandler<TRequest, TResponse>orIRequestHandler<TRequest>. - The host runtime resolves consumers, handlers, interceptors, serializers, and other services from Microsoft DI.
- Per-message DI scopes, consumer context, message headers, filters, interceptors, error handlers, and topology provisioning are cross-cutting host concepts.
- Transport plugins can add provider-specific builders, settings, context operations, topology behavior, and error handling. Prefer keeping provider-specific behavior inside the relevant
SlimMessageBus.Host.*plugin.
- Follow existing patterns in the package/plugin being changed.
- Keep core interfaces in
SlimMessageBustransport-agnostic. - Keep common host behavior in
SlimMessageBus.Hostor shared host extension projects. - Keep provider-specific code, options, and tests in the relevant
SlimMessageBus.Host.*project. - When changing behavior, add or update focused tests under the matching
src/Tests/...project. - Add or update documentation under
docsfor relevant plugin or core functionality changes. Prefer evolving the corresponding*.t.mdtemplate first, then run./build/md-processor.ps1to regenerate the published markdown. - Ask for, or add, respective unit tests for changed functionality. The test stack uses xUnit, Moq, and AwesomeAssertions.