csharp-messaging

Select and implement C# messaging patterns across transports like RabbitMQ and Kafka.

11|1|Updated Feb 9, 2026
One-click install
npx skills add https://github.com/mindcockpit-ai/cognitive-core --skill csharp-messaging
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: csharp-messaging
Source: https://github.com/mindcockpit-ai/cognitive-core/tree/main/language-packs/csharp/skills/csharp-messaging
Command: npx skills add https://github.com/mindcockpit-ai/cognitive-core --skill csharp-messaging

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides clear, graduated guidance for selecting and implementing messaging and middleware patterns in C# applications so teams pick the right solution for scale, durability, and operational needs. It reduces costly architecture mistakes by mapping trade-offs between in-process channels, MediatR, brokered transports, streaming platforms, and enterprise service buses.

Core Features & Use Cases

  • Graduated decision matrix: from System.Threading.Channels for in-process work to NServiceBus for enterprise sagas.
  • Transport-specific examples: runnable patterns and wiring for MediatR, MassTransit+RabbitMQ, Azure Service Bus, Confluent.Kafka, and NServiceBus.
  • Reliability & operations: guidance on retries, idempotency, dead-letter handling, outbox patterns, and backpressure strategies.
  • Use Case: design an order processing pipeline that starts with Channels+MediatR for a single service and migrates to MassTransit+RabbitMQ or Kafka as throughput and cross-service needs grow.

Quick Start

Help me design an order processing pipeline in C#: recommend the appropriate messaging pattern for my scale, explain trade-offs, and show minimal producer and consumer code for the selected transport.

Frequently Asked Questions about csharp-messaging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose the right messaging pattern for my C# application scale?

Choosing the right messaging pattern in C# depends on your scale: use System.Threading.Channels for in-process work, MediatR for CQRS, MassTransit with RabbitMQ for brokered cross-service needs, and Kafka or NServiceBus for high-throughput streaming and enterprise sagas.

How do I handle retries and idempotency in MassTransit with RabbitMQ?

For reliable messaging in MassTransit with RabbitMQ, apply guidance on retries, dead-letter handling, and idempotency patterns to ensure durable message processing and prevent duplicate side effects during failures.

When should I use Kafka over Azure Service Bus for C# messaging?

Use Kafka over Azure Service Bus in C# when you need high-throughput streaming and backpressure handling, whereas Azure Service Bus is better suited for standard brokered transports and traditional enterprise messaging queues.

What is the outbox pattern and how does it work in C# middleware?

The outbox pattern in C# messaging ensures durable message delivery by storing messages in the same database transaction as your domain changes, preventing data inconsistency when publishing events across brokered transports like RabbitMQ or Kafka.

Can I migrate from MediatR to NServiceBus for enterprise sagas?

Yes, you can migrate from MediatR to NServiceBus as your C# system grows, moving from in-process CQRS to enterprise service bus sagas across microservices while utilizing transport abstraction to maintain code flexibility.