Class AmazonCommandQueue<TMarker>
- Assembly
- Savvyio.Extensions.DependencyInjection.SimpleQueueService.dll
Provides a default implementation of the AmazonQueue<TRequest> class tailored for messages holding an ICommand implementation.
public class AmazonCommandQueue<TMarker> : AmazonCommandQueue, IConfigurable<AmazonMessageOptions>, IHealthCheckProvider<IAmazonSQS>, IPointToPointChannel<ICommand, TMarker>, IPointToPointChannel<ICommand>, ISender<ICommand, TMarker>, ISender<ICommand>, IReceiver<ICommand, TMarker>, IReceiver<ICommand>, IDependencyInjectionMarker<TMarker>
Type Parameters
TMarker
- Inheritance
-
AmazonCommandQueue<TMarker>
- Implements
-
IHealthCheckProvider<IAmazonSQS>IPointToPointChannel<ICommand, TMarker>IDependencyInjectionMarker<TMarker>
- Inherited Members
Examples
AmazonCommandQueue<TMarker> is the DI-registered Amazon SQS command queue with a lifetime marker. Inject it and use it as IPointToPointChannel<ICommand> to send and receive commands through Amazon SQS, or as ISender<ICommand> when only the send path is needed.
using Savvyio.Commands;
using Savvyio.Extensions.SimpleQueueService.Commands;
using Savvyio.Messaging;
namespace ExampleApp;
public sealed class SqsCommandService
{
private readonly IPointToPointChannel<ICommand> _channel;
public SqsCommandService(AmazonCommandQueue queue)
{
_channel = queue;
}
public IPointToPointChannel<ICommand> Channel => _channel;
}
Constructors
AmazonCommandQueue(IMarshaller, AmazonCommandQueueOptions<TMarker>)
Initializes a new instance of the AmazonCommandQueue<TMarker> class.
public AmazonCommandQueue(IMarshaller marshaller, AmazonCommandQueueOptions<TMarker> options)
Parameters
marshallerIMarshallerThe IMarshaller that is used when converting ICommand implementations to messages.
optionsAmazonCommandQueueOptions<TMarker>The AmazonCommandQueueOptions<TMarker> used to configure this instance.
Exceptions
- ArgumentNullException
marshallercannot be null - or -optionscannot be null.- ArgumentException
optionsare not in a valid state.
See Also
IPointToPointChannel<TRequest, TMarker>