Class RabbitMqCommandQueue<TMarker>
- Namespace
- Savvyio.Extensions.DependencyInjection.RabbitMQ.Commands
- Assembly
- Savvyio.Extensions.DependencyInjection.RabbitMQ.dll
Provides a default implementation of the RabbitMqMessage class for messages holding an ICommand implementation.
public class RabbitMqCommandQueue<TMarker> : RabbitMqCommandQueue, IDisposable, IAsyncDisposable, IAsyncHealthCheckProvider<IConnection>, IPointToPointChannel<ICommand, TMarker>, IPointToPointChannel<ICommand>, ISender<ICommand, TMarker>, ISender<ICommand>, IReceiver<ICommand, TMarker>, IReceiver<ICommand>, IDependencyInjectionMarker<TMarker>
Type Parameters
TMarker
- Inheritance
-
RabbitMqCommandQueue<TMarker>
- Implements
-
IAsyncHealthCheckProvider<IConnection>IPointToPointChannel<ICommand, TMarker>IDependencyInjectionMarker<TMarker>
- Inherited Members
Examples
The RabbitMqCommandQueue registered by AddRabbitMqCommandQueue is the concrete DI-managed command queue; resolve it to access SendAsync and ReceiveAsync.
using System;
using Microsoft.Extensions.DependencyInjection;
using Savvyio.Commands;
using Savvyio.Extensions.RabbitMQ.Commands;
using Savvyio.Messaging;
namespace ExampleApp;
public class RabbitMqCommandQueueUsage
{
private readonly RabbitMqCommandQueue _queue;
public RabbitMqCommandQueueUsage(RabbitMqCommandQueue queue)
{
_queue = queue;
}
public IPointToPointChannel<ICommand> AsChannel() => _queue;
}
Constructors
RabbitMqCommandQueue(IMarshaller, RabbitMqCommandQueueOptions<TMarker>)
Initializes a new instance of the RabbitMqCommandQueue<TMarker> class.
public RabbitMqCommandQueue(IMarshaller marshaller, RabbitMqCommandQueueOptions<TMarker> options)
Parameters
marshallerIMarshallerThe marshaller used for serializing and deserializing messages.
optionsRabbitMqCommandQueueOptions<TMarker>The options used to configure the RabbitMQ command queue.
Exceptions
- ArgumentNullException
marshallercannot be null -or-optionscannot be null.- ArgumentException
optionsare not in a valid state.
See Also
IPointToPointChannel<TRequest, TMarker>