roger-castaldo/MQContract
48.0
Weak · 21 September 2026
15.2k
lines of production code
C#
primary language
4
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 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 47 → 48 (+0.6)
- Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 77 → 72 (-4.9)
- Architecture 98 → 98 (+0.2)
- Maturity 44 → 45 (+0.4)
- Readiness 56 → 55 (-0.1)
- Security 36 → 38 (+1.8)
- Performance 81 → 81 (+0.0)
Resolved (17)
- Bounded contexts not declared
- Coupling not included (check did not complete)
- Duplicated block (8 lines × 2) (Core/MessageContext.MessageTypes.cs)
- High: security finding (details withheld)
- High: security finding (details withheld)
- Inconsistent naming for registering a consumer for query responses. One method is named 'SubscribeQueryResponseAsync' while the other is 'RegisterQueryResponseConsumerAsync'. These appear to serve the same conceptual purpose of setting up a handler for query responses, but use different verbs ('Subscribe' vs 'Register') and object names ('QueryResponse' vs 'QueryResponseConsumer').
- Inconsistent naming for registering a consumer for query responses. One method is named 'SubscribeQueryResponseAsync' while the other is 'RegisterQueryResponseConsumerAsync'. These appear to serve the same conceptual purpose of setting up a handler for query responses, but use different verbs ('Subscribe' vs 'Register') and object names ('QueryResponse' vs 'QueryResponseConsumer').
- LLM evaluation failed
- Low cohesion: MultiServiceConnection (LCOM4 4) (Core/Connections/MultiServiceConnection.cs)
- Medium: security finding (details withheld)
- Medium: security finding (details withheld)
- Medium: security finding (details withheld)
- No exposed public API
- Per-file coverage withheld — the coverage run did not finish
- Small-team knowledge concentration
- Test reliability not included
- redundant comment (Connectors/RabbitMQ/Connection.cs)
New (49)
- Documentation: no installation or build instructions (README.md)
- Duplicated block (10 lines × 2) (Connectors/AmazonSNQS/MessageMapper.cs)
- Duplicated block (10 lines × 2) (Connectors/AmazonSNQS/MessageMapper.cs)
- Duplicated block (12 lines × 3) (Generators/ConvertersHelper.cs)
- Duplicated block (13 lines × 2) (Core/Connections/MappedConnection.cs)
- Duplicated block (13 lines × 2) (Core/Connections/ResiliencePolicy.cs)
- Duplicated block (15 lines × 2) (Generators/EncodersHelper.cs)
- Duplicated block (18 lines × 2) (Core/MessageContext.MessageTypes.cs)
- Duplicated block (18 lines × 2) (Core/MessageContext.QueryResponse.cs)
- Duplicated block (19 lines × 2) (CQRS/Registrars/ContractedConnectionRegistrar.cs)
- Duplicated block (5 lines × 2) (Core/Connections/Connection.cs)
- Duplicated block (5 lines × 2) (Generators/MessageContextGenerator.cs)
- Duplicated block (7 lines × 2) (Connectors/AmazonSNQS/MessageMapper.cs)
- Duplicated block (8 lines × 2) (Core/MessageContext.QueryResponse.cs)
- High CVE: SSH.NET 2025.1.0
- 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 29 more
Architecture
- Unchanged — 2 containers · 1 contexts · 0 edges
Written by watchdog.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 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 fcd14d6103a743b4d0688a2633a1ffcf788c6261 — 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.