roger-castaldo/MQContract
46.9
Weak · 8 November 2026
15.2k
lines of production code
C#
primary language
7
measurements over time
What this system is
This system is a .NET library for building message queue applications, providing a unified abstraction over diverse messaging providers such as RabbitMQ, Kafka, and Azure Service Bus. It supports both standard publish/subscribe patterns and CQRS architectures, enabling developers to register consumers and processors via attributes and fluent APIs. The library enhances reliability through built-in resilience policies and observability via OpenTelemetry, while a source generator automates the creation of strongly-typed message contexts and routing logic.
Features
Add connectors for ActiveMQ, Amazon SNS/SQS, Apache Pulsar, Azure Service Bus, and Google Pub/Sub
New message service connectors have been introduced for ActiveMQ, Amazon SNS/SQS, Apache Pulsar, Azure Service Bus, and Google Pub/Sub. Each connector implements the standard message service interfaces, providing publish, subscribe, and ping capabilities for their respective messaging platforms. The implementations include connection management, message mapping, and subscription handling specific to each broker or cloud service.
Connectors · high confidence
Add samples for multiple message queue providers
Added sample implementations for connecting to and using ActiveMQ, Amazon SQS/SNS, Apache Pulsar, Azure Service Bus, Google Pub/Sub, HiveMQ, In-Memory, Kafka (with Schema Registry), NATS, RabbitMQ, Redis, and ZeroMQ. The CQRS sample demonstrates command and query processing patterns. These samples provide reference code for integrating with various messaging protocols and services.
Samples · high confidence
Added code generation for message encoding, conversion, and encryption
The Generators area now includes a new Roslyn source generator (MessageContextGenerator) that automatically produces code for handling message contracts. The generator scans for classes inheriting from MQContractMessageContext and detects implementations of IMessageConverter, IMessageTypeEncoder, and IMessageTypeEncryptor interfaces. It generates switch statements and callback functions to route messages to the appropriate encoder, converter, or encryptor. If multiple encoders or encryptors are detected for a single message type, the generator emits warnings (MQCONTRACTGEN001, MQCONTRACTGEN002) to alert the user about the ambiguity.
Generators · high confidence
Added in-memory benchmark suite for message publishing and subscription performance
The BenchMark project now includes a comprehensive set of C\# files implementing performance tests for the MQContract library. This includes message definitions (Announcement, EncodedAnnouncement), custom JSON encoders and contexts, and in-memory benchmark classes that measure the throughput of publishing messages, subscribing to channels, and executing commands. The suite also introduces a FakePublishConnection to simulate service interactions and evaluates the performance impact of various middleware configurations, specifically measuring publish operations with no middleware, metrics, OpenTelemetry (OTEL), resilience policies, and combinations thereof.
BenchMark · high confidence
Introduce CQRS pattern support with command and query processing
Added a new CQRS (Command Query Responsibility Segregation) implementation to the library. This includes the \CqrsConnection\ class and associated consumers (\CommandConsumer\, \QueryResponseConsumer\, etc.) to handle command and query execution. The change introduces interfaces (\ICQRSConnection\, \ICommandProcessor\, \IQueryProcessor\) and concrete implementations for registering processors, managing invocation contexts, and handling message routing. It also adds attributes (\CommandAttribute\, \QueryAttribute\) to mark command and query types, and provides extension methods for fluent registration of processors.
CQRS · high confidence
Introduce channel mapping, consumer registration, and resilience policies for message connections
The Core module now includes a new \ChannelMapper\ class that allows users to map internal channel names to external channel names for publishing, subscribing, and querying. Additionally, the \AConnection\ base class has been expanded to support automatic consumer registration via reflection, message filtering, and configurable resilience policies (retry and circuit-breaker) for both single and bulk message operations. These changes enable more flexible channel routing, easier consumer setup, and improved reliability for message transmission.
Core · high confidence
New message contract attributes and consumer registration extensions
The Abstractions layer now includes new attributes for defining message contracts and consumer behavior, including \ConsumerAttribute\ for channel and group configuration, \MessageAttribute\ for channel and versioning, \QueryMessageAttribute\ for query/response setups, and \MQContractMessageContextAttribute\ for code generation scanning. Additionally, extension methods have been added to \ContractedConnection\, \MappedConnection\, and \MultiServiceConnection\ to support registering \PubSubConsumer\, \PubSubAsyncConsumer\, and \QueryResponseConsumer\ instances, enabling fluent registration of consumers with optional message filtering and header ignoring capabilities.
Abstractions · high confidence
Release of MQContract version 4.0 with new resiliency, tracing, and code generation features
This update introduces a comprehensive resiliency layer backed by Polly, allowing users to configure retry, circuit-breaker, and timeout policies for message transmissions. It also adds OpenTelemetry integration for distributed tracing and activity span generation, and introduces an incremental source generator that produces strongly-typed message contexts at compile time to improve performance and support AOT scenarios. The solution is updated to target .NET 8.0 and .NET 10.0, and includes documentation for these new capabilities.
(repo-wide) · high confidence
Test coverage
Added CQRS testing suite for contract and mapped connections
Added comprehensive unit tests for the CQRS connection layer, covering command and query execution, context sharing, cancellation handling, and error scenarios for both contract-based and mapped service connections.
Testing · high confidence
Dependencies
Updated test and sample project dependencies
The test projects under Testing/ConnectorTesting/ and the sample applications have been updated with new package references. This includes adding Microsoft.Extensions.Diagnostics.Testing (10.4.0), Moq (4.20.72), Microsoft.NET.Test.Sdk (18.6.0), MSTest (4.2.3), and coverlet (10.0.1) to the test suites. Additionally, the NATS sample was updated to include OpenTelemetry (1.15.3) and Microsoft.Extensions.Logging.Debug (8.0.1) for observability and debugging.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 43 → 47 (+4.2)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 70 → 70 (+0.3)
- Architecture 99 → 73 (-25.6)
- Maturity 31 → 48 (+17.2)
- Readiness 58 → 58 (-0.0)
- Security 36 → 35 (-1.0)
- Performance 81 → 75 (-6.1)
Resolved (4)
- Low coverage: Abstractions/MQContractMessageContext.cs (Abstractions/MQContractMessageContext.cs)
- The spelling 'Recieved' is used in two different classes for the same concept (handling an error). This is a consistent misspelling of 'Received', but it represents a deviation from standard English spelling conventions. While consistent within itself, it is a naming error that should be corrected to 'Received' for correctness.
- The word 'Resilience' is spelled inconsistently: 'Resilliance' (with double 'l') in the method name GetResilliancePolicy versus the correct spelling 'Resilience' in the field name queryPolicies (of type ResiliencePolicy) and the type name ResiliencePolicy. This is a typo in the method name.
- redundant comment (Testing/ConnectorTesting/Kafka/KafkaConnectorTests.cs)
New (2)
- TryExecuteQuery returns an awaitable but lacks the Async suffix its 147 peers carry (Abstractions/MQContractMessageContext.cs)
- TryExecuteQuery returns an awaitable but lacks the Async suffix its 147 peers carry (Abstractions/MQContractMessageContext.cs)
Architecture
- Unchanged — 2 containers · 1 contexts · 0 edges
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
roger-castaldo/MQContract 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 8 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit fcd14d6103a743b4d0688a2633a1ffcf788c6261 — the exact code this score is about.
- Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.3+preprod-45ab2cab63de.