Table of Contents

Class AzureCommandQueue<TMarker>

Namespace
Savvyio.Extensions.DependencyInjection.QueueStorage.Commands
Assembly
Savvyio.Extensions.DependencyInjection.QueueStorage.dll

Provides a default implementation of the AzureCommandQueue class that is optimized for Dependency Injection.

public class AzureCommandQueue<TMarker> : AzureCommandQueue, IHealthCheckProvider<QueueServiceClient>, IPointToPointChannel<ICommand, TMarker>, IPointToPointChannel<ICommand>, ISender<ICommand, TMarker>, ISender<ICommand>, IReceiver<ICommand, TMarker>, IReceiver<ICommand>, IDependencyInjectionMarker<TMarker>

Type Parameters

TMarker
Inheritance
AzureCommandQueue<TMarker>
Implements
ISender<ICommand, TMarker>
Inherited Members

Examples

AzureCommandQueue<TMarker> is the DI-registered Azure Queue Storage command queue with a lifetime marker. It implements both ISender<ICommand> and IReceiver<ICommand>. Inject it directly or through one of those interfaces to send and receive commands via Azure Storage queues.

using Savvyio.Commands;
using Savvyio.Extensions.QueueStorage.Commands;
using Savvyio.Messaging;

namespace ExampleApp;

public sealed class AzureCommandService
{
    private readonly ISender<ICommand> _sender;
    private readonly IReceiver<ICommand> _receiver;

    public AzureCommandService(AzureCommandQueue queue)
    {
        _sender = queue;
        _receiver = queue;
    }

    public ISender<ICommand> Sender => _sender;
    public IReceiver<ICommand> Receiver => _receiver;
}

Constructors

AzureCommandQueue(IMarshaller, AzureQueueOptions<TMarker>)

Initializes a new instance of the AzureCommandQueue<TMarker> class.

public AzureCommandQueue(IMarshaller marshaller, AzureQueueOptions<TMarker> options)

Parameters

marshaller IMarshaller

The IMarshaller that is used when converting ICommand implementations to messages.

options AzureQueueOptions<TMarker>

The AzureQueueOptions<TMarker> used to configure this instance.

Exceptions

ArgumentNullException

marshaller cannot be null - or - options cannot be null.

ArgumentException

options are not in a valid state.

See Also