Skip to content
CAI
Software that uses CAICheck a score

zarusz/SlimMessageBus

56.0

Adequate · 21 September 2026

26.9k

lines of production code

C#

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

SlimMessageBus is a .NET messaging framework that provides a unified abstraction for publishing, consuming, and routing messages across diverse transports including Kafka, RabbitMQ, Azure Service Bus, AWS SQS/SNS, and various databases. It supports complex architectural patterns such as hybrid bus composition, transactional outboxes for data consistency, and request-response messaging with timeout management. The system offers extensive extensibility through interceptor pipelines, automatic component discovery, and multiple serialization strategies, while ensuring reliability via circuit breakers, checkpointing, and configurable error handling.

How it got here

2016–2019 — transport expansion and core architecture

32 changes.

This period focused on significantly expanding the messaging framework's transport capabilities by introducing native providers for Kafka, Redis, and Azure Service Bus, alongside an in-memory implementation. The core library underwent substantial architectural improvements, including the introduction of a request-response messaging model, a structured exception hierarchy, and a flexible interceptor pipeline. These features were supported by comprehensive test coverage and infrastructure updates to modernize the build system and target .NET 10.

2020–2023 — Transport expansion and outbox infrastructure

50 changes.

This period focused on expanding transport support by implementing consumers for Azure Service Bus, Azure Event Hubs, Redis, RabbitMQ, and MQTT, alongside new serialization options for Avro, Google Protobuf, and System.Text.Json. The architecture was significantly refactored to introduce a fluent builder API, reflection-based component discovery, and a transactional outbox pattern for reliable message persistence. Concurrently, the codebase established robust consumer error handling, message checkpointing, and comprehensive test coverage for the new features.

2024–2025 — transport expansion and outbox reliability

29 changes.

This period focused on expanding the message bus ecosystem by introducing new transport providers for SQL, NATS, and Amazon SQS/SNS, alongside a memory-based concurrent processing queue. Significant architectural improvements were made to the outbox infrastructure, including refactored lock renewal and cleanup tasks, with dedicated implementations for SQL and PostgreSQL to ensure transactional consistency. The work was heavily supported by comprehensive unit and integration tests for these new features and existing components like RabbitMQ and the circuit breaker.

2026 — multi-provider transport expansion

5 changes.

This period focused on expanding the message bus infrastructure by adding support for PostgreSQL, Google Cloud Pub/Sub, and MongoDB outbox transports. Each new provider was accompanied by comprehensive integration tests and performance benchmarks to ensure reliability and correctness across diverse backend systems.

Features

Add Amazon SNS support and refactor SQS client providers

The Amazon SQS host now supports Amazon SNS in addition to SQS. This change introduces a new client factory structure with interfaces (ISqsClientProvider, ISnsClientProvider) and concrete providers for ambient, static, and temporary (STS-assumed role) credentials for both services. The existing SQS transport is refactored to use these new providers, enabling users to configure SNS publishing alongside SQS messaging within the same host.

src/SlimMessageBus.Host.AmazonSQS/ClientFactory · high confidence

Add Amazon SQS and SNS transport support

Introduces a new host provider for Amazon SQS and SNS, enabling users to configure the message bus to send and receive messages via AWS queues and topics. The implementation includes a builder extension to register the transport, settings for managing SQS and SNS client credentials (ambient, static, or temporary), and automatic topology provisioning to create queues and topics as needed.

src/SlimMessageBus.Host.AmazonSQS · high confidence

Add Avro serialization support for message bus

The SlimMessageBus.Host.Serialization.Avro package now provides an Apache Avro implementation of the message serializer. Users can register the serializer via the AddAvroSerializer extension method, which supports both default reflection-based strategies for message creation and schema lookup, and custom strategies (DictionaryMessageCreationStategy, DictionarySchemaLookupStrategy) for optimized or explicit type/schema registration.

src/SlimMessageBus.Host.Serialization.Avro · high confidence

Add FluentValidation integration for message validation

The new SlimMessageBus.Host.FluentValidation package enables automatic validation of messages using FluentValidation. Users can register validators via the \AddFluentValidation\ extension, which supports scanning assemblies for \IValidator\<T\>\ implementations to automatically apply validation to producers, consumers, and request handlers. The integration also allows customizing error handling through the \IValidationErrorsHandler\ interface, letting users define how validation failures are converted into exceptions.

src/SlimMessageBus.Host.FluentValidation · high confidence

Add Google Cloud Pub/Sub transport support

This release introduces Google Cloud Pub/Sub as a new message bus transport provider. Users can now configure the transport via the \WithProviderGooglePubSub\ extension, specifying the Google Cloud project ID and optional credential paths. The implementation includes automatic topology provisioning to create topics and pull subscriptions, configurable concurrency for consumers, and the ability to customize messages before publishing or intercept topology operations. It also provides a default header serializer that preserves common .NET types in Pub/Sub attributes.

src/SlimMessageBus.Host.GooglePubSub · high confidence

Add Google Protobuf serialization support

Users can now serialize and deserialize messages using Google Protobuf. This change introduces a new \GoogleProtobufMessageSerializer\ that implements the bus's serialization interface, allowing Protobuf-based payloads to be processed. The implementation includes a \MessageParserFactory\ to dynamically create parsers for message types and provides a \SerializationBuilderExtensions\ method (\AddGoogleProtobufSerializer\) to register the serializer within the message bus configuration.

src/SlimMessageBus.Host.Serialization.GoogleProtobuf · high confidence

Add JSON message serialization via Newtonsoft.Json

Users can now serialize and deserialize messages to and from JSON format using the Newtonsoft.Json library. This change introduces the JsonMessageSerializer component, which handles byte and string payloads, and provides a builder extension (AddJsonSerializer) to register the serializer with custom encoding and JsonSerializerSettings in the dependency injection container. Debug and error logging is included to aid in diagnosing serialization issues.

src/SlimMessageBus.Host.Serialization.Json · high confidence

Add MQTT transport provider

Introduces a new MQTT transport provider for SlimMessageBus, enabling users to publish and subscribe to messages via MQTT brokers. This includes the core MqttMessageBus implementation, configuration extensions for setting up the provider and modifying outgoing messages, and specific error handling interfaces for MQTT consumers.

src/SlimMessageBus.Host.Mqtt · high confidence

Add NATS.io transport support with queue group capabilities

Introduces a new NATS.io transport implementation for SlimMessageBus, enabling users to publish and subscribe to messages via the NATS protocol. This addition includes configuration extensions to register the NATS provider, along with specific builder methods for consumers, producers, and request-response handlers to support NATS queue groups (PathKind.Queue) alongside standard topics. The implementation handles connection management, message serialization, and header mapping, allowing applications to leverage NATS as a messaging backend.

src/SlimMessageBus.Host.Nats · high confidence

Add PostgreSQL message bus transport

Users can now use PostgreSQL as a backend for the SlimMessageBus message bus. This change introduces the \SlimMessageBus.Host.PostgreSql\ package, which provides configuration extensions (e.g., \WithProviderPostgreSql\), consumer/producer builder helpers, and a repository layer that stores messages in a \messages\ table. It supports queue and topic-based paths, configurable message ID generation (client-side sequential GUIDs or database-generated UUIDs), transient error retry logic, and schema migration via a built-in topology service.

src/SlimMessageBus.Host.PostgreSql, src/SlimMessageBus.Host.Relational · high confidence

Add circuit breaker support for consumers

This change introduces a new circuit breaker mechanism within the message bus host, allowing consumers to be automatically paused or resumed based on external health signals. By registering an \IConsumerCircuitBreaker\ implementation via the consumer builder, the system monitors the breaker's state; if the circuit opens (indicating a fault), the consumer is stopped and paused, and it resumes only when the circuit closes. This provides a way to gracefully handle downstream failures without losing the consumer instance.

src/SlimMessageBus.Host.CircuitBreaker · high confidence

Add native System.Text.Json serialization support

Introduces a new JSON serialization implementation using the native System.Text.Json library, replacing or supplementing previous serializers. The new JsonMessageSerializer includes a custom ObjectToInferredTypesConverter to handle dynamic object properties more effectively and allows users to configure whether the actual runtime type or the declared message type is used during serialization, which is particularly useful for polymorphic message scenarios.

src/SlimMessageBus.Host.Serialization.SystemTextJson · high confidence

Added local development infrastructure with Docker

Developers can now spin up local instances of the required message brokers and databases for testing using Docker Compose. The new \src/Infrastructure\ directory includes a \docker-compose.yml\ file that provisions containers for Kafka, Zookeeper, MQTT (Mosquitto), PostgreSQL, RabbitMQ, Redis, SQL Server, Azure Storage Emulator, NATS, and MongoDB. A README and helper scripts (\infrastructure.sh\, \infrastructure.ps1\) guide users on starting these services, while specific configuration notes address Azure Event Hub and Service Bus, which require personal cloud instances rather than local containers.

src/Infrastructure · high confidence

Amazon SQS transport upgraded to v4 SDK with SNS support and FIFO enhancements

The Amazon SQS host plugin has been upgraded to use the AWS SDK for .NET v4, introducing support for subscribing to SNS topics via the new SubscribeToTopic configuration, enabling FIFO queue features such as configurable message group and deduplication IDs, and adding builder extensions for queue visibility timeouts, batch sizes, and message attributes.

src · high confidence

AsyncAPI document generation for message bus definitions

The SlimMessageBus host now supports automatic generation of AsyncAPI documents via the Saunter library. By calling the new \AddAsyncApiDocumentGenerator\ extension method, users can register a document generator that introspects the message bus configuration (consumers and producers) to create an AsyncAPI schema. The implementation includes a default filter that excludes the 'Memory' named bus, but allows users to provide a custom filter function to include or exclude specific buses. The generated document maps bus settings to servers and channels, deriving channel keys from consumer paths and subscription names (supporting Azure Service Bus, Kafka, and Azure Event Hubs conventions) and populating message schemas from consumer types.

src/SlimMessageBus.Host.AsyncApi · high confidence

Azure Event Hub configuration builder extensions

The Azure Event Hub host now exposes fluent configuration methods for consumer and producer builders. Users can set the Event Hub consumer group name via Group or EventHubGroup, control checkpointing behavior with CheckpointEvery and CheckpointAfter, and define custom partition key providers for producers using KeyProvider or EhKeyProvider. Additionally, the MessageBusBuilder now supports registering the Event Hub provider via WithProviderEventHub, and internal settings extensions handle the storage and retrieval of these configuration properties.

src/SlimMessageBus.Host.AzureEventHub/Config · high confidence

Azure Service Bus consumer and producer configuration extensions

The Azure Service Bus host now exposes fluent configuration extensions for consumers and producers, allowing users to specify subscription names, SQL and correlation filters, session settings (idle timeout, concurrency), prefetch counts, and message modifiers directly on the builder. Producers can now define default queues/topics, apply message modifiers, and provide custom creation options for queues and topics, while request-response handlers can explicitly target reply queues.

src/SlimMessageBus.Host.AzureServiceBus/Config · high confidence

Azure Service Bus consumer implementation with session support and error handling

The Azure Service Bus consumer has been implemented to support both standard queue/topic subscriptions and message sessions. Users can now configure session-specific settings such as idle timeout and maximum concurrent sessions, as well as standard consumer options like prefetch count, sub-queue selection, and auto-lock renewal duration. The consumer exposes transport-specific context extensions, allowing handlers to access the underlying ServiceBusReceivedMessage and the subscription name. Additionally, a dedicated error handling interface enables explicit control over message outcomes, including the ability to dead-letter messages with custom reasons or return failure states with associated properties.

src/SlimMessageBus.Host.AzureServiceBus/Consumer · high confidence

Azure Service Bus host provider with auto-topology provisioning

The Azure Service Bus transport host is now available, allowing applications to send and receive messages via Azure Service Bus queues and topics. This provider supports automatic creation and management of the underlying Service Bus topology (queues, topics, and subscriptions) through the \TopologyProvisioning\ settings, which can be configured to allow producers or consumers to create entities dynamically. It includes support for session-based consumers, configurable prefetch counts, and message modifiers, integrating with the standard SlimMessageBus consumer and producer models.

src/SlimMessageBus.Host.AzureServiceBus · high confidence

Configurable message checkpointing based on count and duration

Consumers now support configurable checkpointing, allowing offsets to be committed after a specified number of messages or a time interval. The new CheckpointSettings class defines defaults of 30 messages or 5 seconds, which can be overridden via configuration. The CheckpointTrigger implementation monitors message processing and determines when a checkpoint is triggered, while the CheckpointTriggerFactory ensures that all consumers on the same path or group share consistent checkpoint settings, throwing an exception if they differ.

src/SlimMessageBus.Host/Consumer/Checkpointing · high confidence

Initial implementation of the Kafka message bus provider

This change introduces the \SlimMessageBus.Host.Kafka\ package, providing a new transport provider for Apache Kafka. It includes the core \KafkaMessageBus\ implementation for producing and consuming messages, a \DefaultKafkaHeaderSerializer\ for handling header serialization with optional type inference, and a \KafkaMessageBusSettingsValidationService\ to enforce configuration requirements such as broker lists and consumer groups. This allows users to configure SlimMessageBus to communicate via Kafka instead of or alongside existing transports.

src/SlimMessageBus.Host.Kafka · high confidence

Introduce Amazon SQS consumer implementation with SNS envelope support

This change adds the core consumer infrastructure for the Amazon SQS transport, including base and queue-specific consumer classes that handle message retrieval, processing, and batch deletion. It introduces new model classes to parse SNS envelopes (SnsEnvelope, SnsMessageAttribute) received via SQS, enabling support for SNS-to-SQS message patterns. Additionally, it defines a specific error handler interface (ISqsConsumerErrorHandler) and extensions to access the raw SQS transport message within the consumer context.

src/SlimMessageBus.Host.AmazonSQS/Consumer · high confidence

Introduce Redis transport consumer implementations

This change adds the core consumer components for the new Redis message bus host, including \RedisListCheckerConsumer\ for polling Redis lists and \RedisTopicConsumer\ for subscribing to Redis pub/sub channels. It also defines the \IRedisConsumer\ and \IRedisConsumerErrorHandler\ interfaces to integrate these consumers into the message bus framework, enabling users to consume messages from Redis queues and topics.

src/SlimMessageBus.Host.Redis/Consumers · high confidence

Introduce Redis transport provider for message bus

Adds a new Redis-based transport implementation to SlimMessageBus, enabling users to publish and consume messages via Redis Pub/Sub (channels) and Redis Lists (queues). The provider supports configurable connection strings, custom connection factories, and settings for queue polling delays and idle timeouts to optimize CPU usage. It includes built-in logging for connection events (failures, restoration, configuration changes) and wraps message headers in a serializable envelope to compensate for Redis's lack of native header support.

src/SlimMessageBus.Host.Redis · high confidence

Introduce SQL Server outbox persistence with Entity Framework Core support

Users can now persist message outbox data to a SQL Server database using a new \SlimMessageBus.Host.Outbox.Sql\ package. This adds a configurable outbox repository backed by raw \SqlConnection\ and parameterized SQL templates, including automatic schema migration, distributed locking, and batched cleanup of sent messages. For applications using Entity Framework Core, a companion \DbContext\ integration is provided, allowing the outbox to share the application's \DbContext\ and transaction scope seamlessly via a dedicated builder extension.

src/SlimMessageBus.Host.Outbox.Sql · high confidence

Introduce SQL database transport for message bus

Users can now use a SQL database as a transport mechanism for the message bus. This new \SlimMessageBus.Host.Sql\ component provides configuration extensions (e.g., \WithProviderSql\) to register the SQL provider, including connection strings and polling settings. It handles message persistence, locking, and delivery via a dedicated SQL schema (tables for messages, subscriptions, and migrations) and supports various message ID generation modes (client-generated, database GUID, or sequential GUID).

src/SlimMessageBus.Host.Sql · high confidence

Introduce SQL-based transactional outbox with configurable message ID generation

This change adds a new SQL-based transactional outbox provider, allowing users to configure the outbox via \AddOutboxUsingSql\. It introduces settings to control how outbox message IDs are generated (client-side GUID, database NEWID, or database NEWSEQUENTIALID) and enables wrapping message consumption in SQL transactions with optional type filtering. Additionally, a debug mode is available to measure and log SQL operation execution times.

src/SlimMessageBus.Host.Outbox.Sql/Configuration · high confidence

Introduce common SQL infrastructure for database migrations and transient error handling

This change adds the \SlimMessageBus.Host.Sql.Common\ library, which provides the foundational components for SQL-based message bus transports. It introduces a \CommonSqlMigrationService\ that manages database schema provisioning, including table and index creation, with support for distributed locking to prevent race conditions during concurrent migrations. Additionally, it includes a \SqlHelper\ class that implements automatic retry logic for transient SQL errors (such as connection timeouts or lock timeouts) and a \CommonSqlRepository\ base class for executing SQL commands with configurable timeouts and transaction support.

src/SlimMessageBus.Host.Sql.Common · high confidence

Introduce hybrid message serialization with type-based routing

The library now supports a \HybridMessageSerializerProvider\ that routes message serialization and deserialization to different serializers based on the message type. Users can configure this via \AddHybridSerializer\, specifying a default serializer and mapping specific message types to their respective serializers, allowing mixed serialization strategies within a single message bus host.

src/SlimMessageBus.Host.Serialization.Hybrid · high confidence

Introduce in-memory message bus transport with configurable serialization and publishing modes

Adds a new \MemoryMessageBus\ implementation for in-process message passing, allowing users to register an in-memory transport via \WithProviderMemory()\. This transport supports auto-declaring producers and consumers from assemblies (similar to MediatR) and offers performance and behavioral tuning: users can disable message serialization to pass object references directly, switch publish operations from blocking (synchronous) to non-blocking (asynchronous), and enable or disable message headers to reduce memory allocations.

src/SlimMessageBus.Host.Memory · high confidence

Introduce request-response messaging interfaces with cancellation and void-response support

The library now exposes a dedicated request-response API via new interfaces: \IRequest\<TResponse\>\ and \IRequest\ (for requests with no response), \IRequestHandler\<TRequest, TResponse\>\ and \IRequestHandler\<TRequest\>\ (supporting \CancellationToken\), and \IRequestResponseBus\ with \Send\ methods that accept a \path\, \headers\, \timeout\, and \CancellationToken\. The legacy \IRequestMessage\<TResponse\>\ marker interface is marked obsolete in favor of \IRequest\<TResponse\>\. This enables users to send typed requests with timeouts and cancellation, handle requests that do not return a value, and integrate cancellation tokens into handlers.

src/SlimMessageBus/RequestResponse · high confidence

Introduce request-response timeout management and header utilities

The RequestResponse module now includes infrastructure to manage pending requests, automatically cancelling and cleaning up requests that exceed their expiration time or are explicitly cancelled via a timer-based cleanup process. This is supported by new header constants (RequestId, ReplyTo, Expires, Error) and extension methods for safely reading and setting message headers, including DateTimeOffset handling. Additionally, a Void type is introduced to represent requests that do not expect a response.

src/SlimMessageBus.Host/RequestResponse · high confidence

Introduce secret management tooling for samples and tests

A new SecretStore component has been added to src/Tools to centralize secret management for local development and testing. It provides a chained secret store that resolves values from environment variables and local files (secrets.txt), and a SecretService that populates placeholders in the format {{secretName}} within configuration strings. This allows samples and tests to securely inject secrets without hardcoding them.

src/Tools · high confidence

Introduce structured exception hierarchy and core messaging interfaces

The library now provides a dedicated exception hierarchy (MessageBusException, ConsumerMessageBusException, ProducerMessageBusException, and specific variants like SendMessageBusException) to allow users to catch and handle message bus errors more precisely. Additionally, the core messaging contracts are defined through new interfaces including IMessageBus, IPublishBus, IConsumer, and context interfaces (IConsumerContext, IProducerContext), establishing the foundation for message consumption, publishing, and context-aware processing.

src/SlimMessageBus · high confidence

Introduces core outbox repository interfaces and message model

The outbox subsystem now exposes a structured repository layer, adding the \IOutboxMessageFactory\ for creating messages, \IOutboxMessageRepository\ for locking, updating, and deleting outbox entries, and \IOutboxMigrationService\ for schema initialization. These interfaces operate on the new \OutboxMessage\ entity, which stores the bus name, message type, payload, path, and headers, providing the foundational data access contracts for the transactional outbox implementation.

src/SlimMessageBus.Host.Outbox/Repositories · high confidence

Introduction of transactional outbox infrastructure

This change introduces the core infrastructure for a transactional outbox pattern within the SlimMessageBus.Host.Outbox package. It adds an abstract base class for managing nested database transactions, a notification service interface to signal when messages are ready for publishing, and utility classes such as an async manual reset event and instance ID provider. These components provide the foundational mechanism for ensuring message durability alongside database operations.

src/SlimMessageBus.Host.Outbox · high confidence

New AssemblyQualifiedNameMessageTypeResolver with configurable strong name emission and redirects

The host now includes a new \AssemblyQualifiedNameMessageTypeResolver\ that maps message types to and from string headers using the type's \AssemblyQualifiedName\. By default, the resolver strips redundant assembly metadata (Version, Culture, PublicKeyToken) from the header value, but this behavior can be controlled via the \EmitAssemblyStrongName\ property. Additionally, the resolver supports an extensibility mechanism via \IAssemblyQualifiedNameMessageTypeResolverRedirect\, allowing users to provide custom mappings for specific types or names.

src/SlimMessageBus.Host/MessageTypeResolver · high confidence

New PostgreSQL outbox plugin with transactional consumer support

Added a new \SlimMessageBus.Host.Outbox.PostgreSql\ package that enables storing outbox messages in a PostgreSQL database. This includes configuration extensions (\AddOutboxUsingPostgreSql\) to register the repository and migration services, and a \UsePostgreSqlTransaction\ extension that wraps consumer message handling in a \SqlTransaction\ to ensure atomicity with local database operations. The implementation features automatic schema migration, retry logic for transient PostgreSQL errors, and table-level locking for safe multi-instance message polling.

src/SlimMessageBus.Host.Outbox.PostgreSql · high confidence

New helper utilities and compatibility shims for SlimMessageBus.Host

This change introduces a new set of helper classes in the Host project to support modern .NET features and improve runtime robustness. It adds compatibility shims (CompatAttributes, CompatMethods, CompatRecord) to enable multi-targeting for older frameworks like .NET Standard 2.0 by providing missing language features such as records and dictionary extensions. It also includes a new Assert class for validation, InterceptorExtensions for ordering, and ReflectionUtils which leverages compiled expressions to optimize method invocation performance. Additionally, it adds Retry logic with jitter, silent disposal utilities, and a JoinOrSingle string helper.

src/SlimMessageBus.Host/Helpers · high confidence

New interceptor framework and hybrid bus architecture

The host now supports a new interceptor pipeline for intercepting message production (publish/send) and consumption, allowing cross-cutting concerns to be applied around message handling. Additionally, a hybrid bus implementation is introduced, enabling the composition of multiple child message buses into a single master bus that routes messages based on type, with configurable execution modes (sequential or parallel) for publishing to multiple targets.

src/SlimMessageBus.Host · high confidence

New message processing queue implementations for memory host

The memory message bus host now includes new queue implementations for processing messages: \ConcurrentMessageProcessorQueue\ for concurrent processing with configurable concurrency limits, and \MessageProcessorQueue\ for sequential processing. These classes implement the \IMessageProcessorQueue\ interface and handle message enqueuing, processing, and error logging. The \AbstractMessageProcessorQueue\ provides shared functionality including scope creation for non-blocking published messages and error handling with logging.

src/SlimMessageBus.Host.Memory/Consumers · high confidence

New reflection-based discovery scanner for message bus components

The library now includes a new \ReflectionDiscoveryScanner\ class within the \SlimMessageBus.Host.Configuration.Discovery\ namespace. This component enables automatic discovery of consumer types, request handlers, and various interceptors (producer, consumer, publish, send, and request handler interceptors) by scanning specified assemblies for classes implementing specific generic interfaces. It also introduces supporting data models (\DiscoveryConsumerType\ and \DiscoveryProspectType\) to represent the discovered types and their relationships, facilitating the registration of message bus handlers without manual configuration.

src/SlimMessageBus.Host.Configuration/Discovery · high confidence

New samples for AsyncAPI, Circuit Breaker, Domain Events, and Hybrid messaging

The samples directory now includes four new demonstration projects. The AsyncAPI sample shows how to generate AsyncAPI documentation for message bus configurations using the Saunter library. The Circuit Breaker Health Check sample demonstrates integrating .NET health checks with the message bus to pause consumers when specific health tags are unhealthy. The Domain Events sample illustrates implementing domain events within an ASP.NET Core application using the in-memory provider. Finally, the Hybrid Console App sample shows how to route different message types across multiple transports (Memory and Azure Service Bus) within a single application.

src/Samples · high confidence

RabbitMQ transport implementation with publisher confirms and connection resilience

The RabbitMQ host transport is now implemented, introducing support for the RabbitMQ.Client v7 API. This update adds publisher confirms to guarantee message delivery (with a configurable timeout), automatic connection recovery with retry logic to handle server restarts, and a topology service that automatically declares exchanges, queues, and bindings (including dead-letter routing) at startup. It also includes a header value converter to handle RabbitMQ client encoding quirks and validation for required producer/consumer settings.

src/SlimMessageBus.Host.RabbitMQ · high confidence

Support for nested SQL transactions

The SQL transaction service now supports nested transactions through a reference-counting mechanism in the AbstractSqlTransactionService. This allows multiple BeginTransaction calls to be made without starting separate physical database transactions; the underlying transaction is only committed or rolled back when the outermost transaction scope is completed, ensuring data consistency across nested operations.

src/SlimMessageBus.Host.Sql.Common/Transactions · high confidence

Transactional outbox interception for publish and consume operations

The outbox plugin now uses dedicated interceptors to manage transactional boundaries for message handling. For publishing, the OutboxForwardingPublishInterceptor captures outgoing messages and forwards them to the outbox store instead of sending them directly, deferring the actual notification until after the transaction commits. For consuming, the TransactionScopeConsumerInterceptor wraps message processing in a TransactionScope, ensuring that consumer logic executes within a transaction context that can be completed or rolled back alongside the outbox state.

src/SlimMessageBus.Host.Outbox/Interceptors · high confidence

Architecture

Extracted configuration models into a separate package

The configuration settings for the message bus have been extracted into a dedicated \SlimMessageBus.Host.Configuration\ package. This change introduces a new set of strongly-typed configuration classes, including \MessageBusSettings\, \ConsumerSettings\, \ProducerSettings\, and \RequestResponseSettings\, which define properties for topics, queues, consumer modes, and header modifiers. By centralizing these models, the library now provides a cleaner, more modular way to configure message bus behavior, separating the configuration data structures from the transport-specific implementations.

src/SlimMessageBus.Host.Configuration/Settings · high confidence

New internal collection utilities for caching and thread-safe access

Added a new \SlimMessageBus.Host.Collections\ namespace containing internal infrastructure classes to support runtime type caching and thread-safe dictionary operations. This includes \SafeDictionaryWrapper\ for synchronized read/write access, \RuntimeTypeCache\ and \GenericTypeCache\ for caching reflection-based interceptor and producer lookups, and \KindMapping\ for validating message bus path configurations. These components provide the underlying data structures required for the host's performance optimizations and configuration validation.

src/SlimMessageBus.Host/Collections · high confidence

Behavioural changes

Azure Event Hub consumer implementation refactored to support partition-level processing and error handling

The Azure Event Hub consumer logic has been restructured to introduce a hierarchical processing model: EhGroupConsumer manages the EventProcessorClient lifecycle, while EhPartitionConsumer handles individual partition leases, message processing, and checkpointing. This change enables partition-specific error handling via the new IEventHubConsumerErrorHandler\<T\> interface and provides access to the native Azure Event Hubs EventData through EhConsumerContextExtensions, allowing consumers to inspect transport-level details like message properties and offsets.

src/SlimMessageBus.Host.AzureEventHub/Consumer · high confidence

Azure Event Hub host now skips storage requirements for producer-only configurations

The Azure Event Hub integration has been updated to no longer require Azure Blob Storage configuration when the bus is set up exclusively for publishing messages. Previously, storage connection strings and container names were mandatory for all Event Hub setups. The new implementation in \EventHubMessageBus\ and \EventHubMessageBusSettingsValidationService\ checks if any consumers are declared; if not, it omits the initialization of the \BlobContainerClient\ and skips validation of storage settings, allowing users to configure a lightweight producer-only bus without provisioning Azure Storage resources.

src/SlimMessageBus.Host.AzureEventHub · high confidence

Build system migrated to PowerShell

The build scripts have been moved to PowerShell, replacing the previous build tooling. This change introduces a new folder structure with dedicated scripts for building, testing, packaging, and pushing NuGet packages, along with a markdown preprocessor for documentation generation.

build · high confidence

Configurable outbox and transaction scope settings with type filtering

The outbox configuration experience is improved by introducing dedicated settings classes (OutboxSettings and OutboxMessageCleanupSettings) that allow users to tune polling batches, lock expiration, delivery attempts, and cleanup intervals. Configuration methods on the message bus builder now support optional message type filters, enabling selective enabling of the outbox or transaction scopes for specific message types rather than applying them globally.

src/SlimMessageBus.Host.Outbox/Configuration · high confidence

Introduce ConsumerContext for per-message scope and lazy consumer resolution

The library now exposes a \ConsumerContext\ object that provides access to message metadata (path, headers, cancellation token) and a \Properties\ dictionary for custom state. Crucially, consumer instances are now resolved lazily via a factory pattern within this context, allowing interceptors to run and establish scoped dependencies (such as database transactions) before the consumer is instantiated. Extension methods are also provided to easily retrieve typed properties or access the master message bus from the context.

src/SlimMessageBus.Host/Consumer/Context · high confidence

Kafka configuration model and fluent API refactoring

The Kafka host provider's configuration has been restructured to use a new \KafkaMessageBusSettings\ class and a set of fluent builder extensions. Users now configure the Kafka provider via \WithProviderKafka\, which accepts an action to set broker lists, custom producer/consumer factories, and header serializers. The API introduces specific methods for consumer groups (\KafkaGroup\), checkpointing (\CheckpointEvery\, \CheckpointAfter\), and producer control (\KeyProvider\, \PartitionProvider\, \EnableProduceAwait\), replacing previous hook-based mechanisms with a more explicit, settings-driven approach.

src/SlimMessageBus.Host.Kafka/Configs · high confidence

Kafka consumer loop failure interception and manual offset control

The Kafka consumer implementation now supports intercepting fatal failures that terminate the consumer group loop via the new IKafkaLoopFailureInterceptor interface, allowing applications to handle unrecoverable errors. Additionally, the consumer architecture introduces explicit manual offset management through the IKafkaCommitController, replacing previous automatic commit behaviors with checkpoint-based manual commits to ensure offsets are committed only after successful message processing.

src/SlimMessageBus.Host.Kafka/Consumer · high confidence

New ConfigurationMessageBusException for detailed configuration errors

A new ConfigurationMessageBusException class has been introduced to provide more specific error reporting during message bus configuration. This exception extends the existing MessageBusException and includes a constructor that accepts MessageBusSettings, allowing error messages to automatically include the name of the misconfigured message bus instance when available, thereby improving debugging clarity for users encountering configuration issues.

src/SlimMessageBus.Host.Configuration/Exceptions · high confidence

New DI registration and configuration infrastructure for SlimMessageBus

The DependencyResolver location now provides the core service registration logic for the message bus host. It introduces \ServiceCollectionExtensions\ to register the master bus, hybrid transport, and various controls (consumer, topology) into Microsoft.Extensions.DependencyInjection. New components include \CurrentMessageBusProvider\ to resolve the active bus instance, \ConsumerMethodPostProcessor\ to finalize consumer method invocations, and \MessageBusHostedService\ to manage the bus lifecycle within hosted environments. The \AddServicesFromAssembly\ API is also exposed here, allowing users to scan assemblies for consumers and interceptors with configurable lifetimes.

src/SlimMessageBus.Host/DependencyResolver · high confidence

New message-scoping infrastructure for consumer interception and lifecycle

The consumer host now includes a dedicated message-scoping layer that allows interceptors to control consumer start/stop behavior and enables services to access the current message's dependency-injection scope. This is implemented via the new AbstractConsumer base class (which orchestrates start/stop with semaphore-based synchronization and interceptor hooks), the IAbstractConsumerInterceptor interface (with CanStart, CanStop, Started, and Stopped lifecycle methods), and a set of scope-management types (IMessageScope, IMessageScopeAccessor, MessageScopeAccessor, MessageScope, and MessageScopeWrapper) that use AsyncLocal storage to expose the current IServiceProvider during message processing.

src/SlimMessageBus.Host/Consumer · high confidence

RabbitMQ consumer now supports manual and automatic message acknowledgements

The RabbitMQ consumer implementation has been refactored to allow users to choose between automatic acknowledgements (handled directly by the RabbitMQ broker) and manual acknowledgements (handled by the application after message processing). This change introduces new configuration options and internal components, such as \RabbitMqAutoAcknowledgeMessageProcessor\ and \RabbitMqMessageConfirmOptions\, to manage how messages are confirmed or nacked. Users can now configure their consumers to explicitly control message lifecycle, improving reliability for scenarios where processing success needs to be verified before acknowledging receipt.

src/SlimMessageBus.Host.RabbitMQ/Consumers · high confidence

RabbitMQ transport configuration and behavior enhancements

The RabbitMQ transport now supports publisher confirms for guaranteed message delivery, configurable message acknowledgement modes (automatic, before processing, or manual) to control delivery guarantees, and dead-letter exchange handling. Users can also customize message routing keys and properties, define custom topology initializers, and configure exchange types including the delayed message plugin.

src/SlimMessageBus.Host.RabbitMQ/Config · high confidence

Refactored consumer error handling and message processing pipeline

The consumer message processing pipeline has been restructured to improve error management and concurrency control. Error handling now returns an explicit \ProcessResult\ (Success, Failure, or Retry) from \IConsumerErrorHandler\, allowing consumers to dictate whether a message should be retried, dead-lettered, or marked as failed, rather than relying on exception throwing or delegate callbacks. The core \MessageProcessor\ and \MessageHandler\ classes have been refactored to support this new result-based flow, including support for per-message scopes and interceptor pipelines. Additionally, a new \ConcurrentMessageProcessorDecorator\ has been introduced to manage concurrency limits using semaphores, ensuring that only a specified number of messages are processed simultaneously while tracking pending counts and background exceptions.

src/SlimMessageBus.Host/Consumer/MessageProcessors · high confidence

Refactored message bus configuration into a new builder API

The configuration API in \SlimMessageBus.Host.Configuration\ has been restructured to use a dedicated builder pattern. The \MessageBusBuilder\ now exposes fluent methods (\Produce\, \Consume\, \Handle\) that return specific builder classes (\ProducerBuilder\, \ConsumerBuilder\, \HandlerBuilder\) for configuring message production, consumption, and request-response handling. This change introduces new base classes (\AbstractConsumerBuilder\, \AbstractHandlerBuilder\) and interfaces (\IConsumerBuilder\, \IProducerBuilder\) to manage settings and post-configuration actions, replacing the previous configuration mechanism.

src/SlimMessageBus.Host.Configuration/Builders · high confidence

Refactored outbox service architecture with dedicated lock renewal and cleanup tasks

The outbox service implementation has been restructured to improve reliability and separation of concerns. A new \OutboxLockRenewalTimer\ and its factory have been introduced to handle distributed lock renewal independently, ensuring that message processing locks are maintained correctly across instances. Additionally, a dedicated \OutboxCleanUpTask\ now manages the periodic removal of sent messages based on configurable age and batch settings, replacing previous inline cleanup logic. The \OutboxSendingTask\ has been updated to coordinate these new components, ensuring that schema migration and message sending loops are properly lifecycle-managed alongside the new lock renewal mechanism.

src/SlimMessageBus.Host.Outbox/Services · high confidence

Support for resolving MessageBus within ASP.NET Core request scopes

The AspNetCore integration now allows the MessageBus to be resolved from the current HTTP request scope when available, falling back to the application root container otherwise. This is achieved by introducing \HttpContextAccessorCurrentMessageBusProvider\, which leverages \IHttpContextAccessor\ to access request-specific services, and a new \AddAspNet\ extension method that registers this provider. This change improves configuration for scenarios where the MessageBus is hosted as a singleton but needs to respect per-request lifetimes or dependencies.

src/SlimMessageBus.Host.AspNetCore · high confidence

Test coverage

Added SomeMessage2 test message; Added benchmarks for consumer invocation and task result access; Added integration and benchmark tests for SQL DbContext outbox; Added integration test for MessageBus.Current scope resolution; Added integration tests for ASP.NET Core scoping and hybrid bus message scope propagation; Added integration tests for Azure Event Hub transport; Added integration tests for IMessageScopeAccessor; Added integration tests for PostgreSQL outbox repository; Added integration tests for PostgreSQL outbox with multiple message transports; Added integration tests for RabbitMQ transport default exchange and message bus behaviors; Added integration tests for SQL outbox message repository; Added integration tests for the MQTT message bus provider; Added memory bus benchmark suite with interceptor performance tests; Added serialization benchmark suite; Added test coverage for message bus host components; Added test infrastructure utilities for SlimMessageBus.Host; Added test suite for Azure Service Bus provider configuration and integration; Added test suite for Google Cloud Pub/Sub transport; Added tests and benchmarks for SQL and PostgreSQL transports; Added tests for AsyncAPI document generation; Added tests for Google Protobuf serialization; Added tests for HybridMessageBus lifecycle and message routing; Added tests for OutboxForwardingPublishInterceptor behavior; Added tests for RabbitMQ consumer acknowledgment and wildcard routing key matching; Added tests for dependency resolver configuration and consumer processing; Added tests for interceptor pipelines; Added tests for message processor queue concurrency behavior; Added tests for the MongoDB Outbox plugin; Added unit and integration tests for Kafka producer configuration and message bus behavior; Added unit and integration tests for NATS message bus host; Added unit and integration tests for the Amazon SQS transport; Added unit and integration tests for the Redis message bus transport; Added unit tests for FluentValidation interceptors; Added unit tests for HybridMessageSerializerProvider and DI integration; Added unit tests for MessageBus provider configuration; Added unit tests for MessageHeaderService; Added unit tests for PendingRequestManager and PendingRequestState; Added unit tests for RabbitMQ configuration and publisher confirms; Added unit tests for RabbitMQ consumer and response consumer logic; Added unit tests for RabbitMQ host components; Added unit tests for ReflectionUtils helper methods; Added unit tests for System.Text.Json serialization and builder extensions; Added unit tests for circuit breaker consumer interceptor; Added unit tests for consumer lifecycle, concurrency, and message processing; Added unit tests for host collection utilities; Added unit tests for message bus configuration builders; Added unit tests for outbox cleanup and sending tasks; Added unit tests for outbox infrastructure components; Initial test suite for the in-memory message bus provider; New integration test infrastructure for SlimMessageBus.

Dependencies

Samples and host plugins ported to .NET 10

The sample applications and host plugin project files have been updated to target .NET 10.0. This change aligns the project dependencies with the .NET 10 runtime, ensuring compatibility with the latest framework features and libraries.

(dependencies) · high confidence

Housekeeping

Repository initialization with documentation and infrastructure scaffolding

The repository has been initialized with essential project scaffolding, including a comprehensive README detailing the SlimMessageBus .NET messaging framework, its supported transports (Kafka, RabbitMQ, Azure Service Bus, etc.), and usage examples. New files include AGENTS.md for development guidelines, CONTRIBUTING.md for pull request processes, a Jekyll theme configuration, an SVG icon, and shell/PowerShell scripts to launch local infrastructure via Docker Compose. A .gitignore file has also been added to exclude build artifacts and secrets.

(repo-wide) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.

Score

  • CAI 53 → 56 (+2.5)
  • Rubric changed (rubric-2026.08.18 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 71 → 68 (-2.4)
  • Architecture 77 → 82 (+5.4)
  • Maturity 65 → 65 (+0.2)
  • Readiness 58 → 62 (+4.1)
  • Security 41 → 44 (+2.7)
  • Domain Modelling 95 (new)
  • Event-Driven 86 → 86 (+0.0)
  • Performance 72 → 72 (+0.0)

Resolved (46)

  • Bounded contexts not declared
  • Change coupling: AsbProducerBuilderExtensions.cs ↔ ServiceBusMessageBus.cs (src/SlimMessageBus.Host.AzureServiceBus/Config/AsbProducerBuilderExtensions.cs)
  • Change coupling: AsbProducerBuilderExtensions.cs ↔ ServiceBusMessageBusSettings.cs (src/SlimMessageBus.Host.AzureServiceBus/Config/AsbProducerBuilderExtensions.cs)
  • Coverage not measured — analyzer environment
  • Duplicated block (11 lines × 2) (src/SlimMessageBus.Host.Sql/SqlSequentialGuidGenerator.cs)
  • Duplicated block (12 lines × 2) (src/SlimMessageBus.Host/Services/MessageBusSettingsValidatorService.cs)
  • Duplicated block (15 lines × 2) (src/SlimMessageBus.Host.FluentValidation/FluentValidationMessageBusBuilder.cs)
  • Duplicated block (17 lines × 2) (src/SlimMessageBus.Host.Outbox.Sql/Interceptors/SqlTransactionConsumerInterceptor.cs)
  • Duplicated block (6 lines × 2) (src/SlimMessageBus.Host.Outbox.MongoDb/Repositories/MongoDbOutboxMessageRepository.cs)
  • Duplicated block (7 lines × 2) (src/SlimMessageBus.Host.Outbox.MongoDb/Repositories/MongoDbOutboxMessageRepository.cs)
  • Duplicated block (8 lines × 2) (src/SlimMessageBus.Host.AmazonSQS/Services/SqsTopologyService.cs)
  • Duplicated block (8 lines × 2) (src/SlimMessageBus.Host.Sql/ObjectToInferredTypesConverter.cs)
  • Duplicated block (8 lines × 3) (src/SlimMessageBus.Host.Serialization.SystemTextJson/ObjectToInferredTypesConverter.cs)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • …and 26 more

New (104)

  • AnalyzerSeverityNone (src/.editorconfig)
  • AnalyzerSeverityNone (src/.editorconfig)
  • AnalyzerSeverityNone (src/.editorconfig)
  • CommentedOutCode (src/Tests/SlimMessageBus.Host.Memory.Benchmark/Program.cs)
  • CommentedOutCode (src/Tests/SlimMessageBus.Host.Memory.Benchmark/Program.cs)
  • CoverageExclusion (src/SlimMessageBus.Host.Kafka/Configs/KafkaAbstractConsumerBuilderExtensions.cs)
  • CoverageExclusion (src/SlimMessageBus.Host.Kafka/Configs/KafkaAbstractConsumerBuilderExtensions.cs)
  • CoverageExclusion (src/SlimMessageBus.Host/PlatformExtensions.cs)
  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)
  • Duplicated block (10 lines × 2) (src/SlimMessageBus.Host.PostgreSql/Config/PostgreSqlConsumerBuilderExtensions.cs)
  • Duplicated block (10 lines × 2) (src/SlimMessageBus.Host.PostgreSql/ServiceScopeExtensions.cs)
  • Duplicated block (10 lines × 2) (src/SlimMessageBus.Host.RabbitMQ/RabbitMqMessageBus.cs)
  • Duplicated block (11 lines × 2) (src/SlimMessageBus.Host.Memory/MemoryMessageBusBuilder.cs)
  • Duplicated block (11 lines × 2) (src/SlimMessageBus.Host.Outbox.PostgreSql/PostgreSqlHelper.cs)
  • Duplicated block (11 lines × 2) (src/SlimMessageBus.Host.Outbox.PostgreSql/PostgreSqlHelper.cs)
  • Duplicated block (12 lines × 2) (src/SlimMessageBus.Host.PostgreSql/PostgreSqlSequentialGuidGenerator.cs)
  • Duplicated block (12 lines × 2) (src/SlimMessageBus.Host.RabbitMQ/RabbitMqMessageBusSettingsValidationService.cs)
  • Duplicated block (13 lines × 2) (src/SlimMessageBus.Host.AmazonSQS/Services/SqsTopologyService.cs)
  • Duplicated block (15 lines × 2) (src/SlimMessageBus.Host.FluentValidation/FluentValidationMessageBusBuilder.cs)
  • …and 84 more

Changes since last survey

  • 2 commits — 2 feature/other, 0 fixes

By area

  • src/SlimMessageBus.Host — 1 commit
  • src/SlimMessageBus.Host.GooglePubSub — 1 commit

Notable commits

  • change: Add Google Cloud Pub/Sub transport
  • change: Handle RabbitMQ RPC deserialization failures

API surface

  • Unchanged — 10 HTTP endpoints

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

zarusz/SlimMessageBus was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 21 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit cc610c96d6be124525d5b67335451eb7a2925b82 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-28e75b8e3254.