Table of Contents

AmazonCommandQueue Class

Definition

Provides a default implementation of the AmazonQueue<TRequest> class tailored for messages holding an ICommand implementation.

public class AmazonCommandQueue : AmazonQueue<ICommand>, IConfigurable<AmazonMessageOptions>, IPointToPointChannel<ICommand>, ISender<ICommand>, IReceiver<ICommand>, IHealthCheckProvider<IAmazonSQS>
Inheritance
object
AmazonCommandQueue
Implements
Derived
Inherited Members

Examples

AmazonCommandQueue sends and receives commands through Amazon SQS. Configure it with AmazonCommandQueueOptions and use it as IPointToPointChannel<ICommand>.

using System;
using Amazon;
using Amazon.Runtime;
using Savvyio.Commands;
using Savvyio.Extensions.SimpleQueueService.Commands;
using Savvyio.Messaging;

namespace ExampleApp;

public class SqsCommandQueueConfig
{
    public static AmazonCommandQueueOptions CreateOptions() => new AmazonCommandQueueOptions { Credentials = new AnonymousAWSCredentials(), Endpoint = RegionEndpoint.EUWest1, SourceQueue = new Uri("https://sqs.eu-west-1.amazonaws.com/123456789012/commands") };
    public static IPointToPointChannel<ICommand> AsChannel(AmazonCommandQueue q) => q;
}

Constructors

Name Description
AmazonCommandQueue(IMarshaller, AmazonCommandQueueOptions)

Initializes a new instance of the AmazonCommandQueue class.

Methods

Name Description
GetHealthCheckTarget()

Returns a new Amazon.SQS.IAmazonSQS client instance configured for health probing of the underlying Amazon SQS service.

ReceiveAsync(Action<AsyncOptions>)

Receive one or more command(s) asynchronous using Point-to-Point Channel/P2P MEP.

SendAsync(IEnumerable<IMessage<ICommand>>, Action<AsyncOptions>)

Sends the specified messages whose generic type argument is ICommand asynchronous using Point-to-Point Channel/P2P MEP.

See Also

AmazonQueue<TRequest>