AmazonCommandQueue Class
Definition
- Namespace
- Savvyio.Extensions.SimpleQueueService.Commands
- Assemblies
- Savvyio.Extensions.SimpleQueueService.dll
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
-
objectAmazonCommandQueue
- Implements
-
IHealthCheckProvider<IAmazonSQS>
- 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 |
See Also
AmazonQueue<TRequest>