Table of Contents

Namespace Savvyio.Commands.Messaging

Assembly: Savvyio.Commands.Messaging.dll

Unlike in-process command dispatch through CommandDispatcher, commands sent to external services need a transport envelope. CommandExtensions.ToMessage<T> wraps any ICommand in an IMessage<T> envelope, and InMemoryCommandQueue replays that envelope in unit tests without a real broker.

Start with CommandExtensions.ToMessage<T>, hand the IMessage<T> to a queue from one of the transport extension packages (NATS, RabbitMQ, Azure Queue Storage, Amazon SQS), and swap in InMemoryCommandQueue when you need to test the dispatch pipeline without infrastructure.

Availability: .NET 10 and .NET 9

Extension Members

Type Ext Methods
T ⬇️ ToMessage<T>

Classes

CommandExtensions

Extension methods for the ICommand interface.

InMemoryCommandQueue

Provides an in-memory implementation of the IPointToPointChannel<TRequest> interface useful for unit testing and the likes thereof.