Table of Contents

Class AmazonMessage<TRequest>

Namespace
Savvyio.Extensions.SimpleQueueService
Assembly
Savvyio.Extensions.SimpleQueueService.dll

Represents the base class from which all implementations of AWS SQS should derive.

public abstract class AmazonMessage<TRequest> : IConfigurable<AmazonMessageOptions> where TRequest : IRequest

Type Parameters

TRequest

The type of the model to handle.

Inheritance
AmazonMessage<TRequest>
Implements
Derived

Constructors

AmazonMessage(IMarshaller, AmazonMessageOptions)

Initializes a new instance of the AmazonMessage<TRequest> class.

protected AmazonMessage(IMarshaller marshaller, AmazonMessageOptions options)

Parameters

marshaller IMarshaller

The IMarshaller that is used when converting models to messages.

options AmazonMessageOptions

The AmazonMessageOptions used to configure this instance.

Exceptions

ArgumentNullException

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

ArgumentException

options are not in a valid state.

Fields

MessageTypeAttributeKey

The key for the message type attribute.

protected const string MessageTypeAttributeKey = "type"

Field Value

string

Properties

Marshaller

Gets the by constructor provided serializer context.

protected IMarshaller Marshaller { get; }

Property Value

IMarshaller

The by constructor provided serializer context.

Options

Gets the configured AmazonMessageOptions of this instance.

public AmazonMessageOptions Options { get; }

Property Value

AmazonMessageOptions

The configured AmazonMessageOptions of this instance.

UseFirstInFirstOut

Gets a value indicating whether AWS SQS is configured for FIFO.

protected bool UseFirstInFirstOut { get; }

Property Value

bool

true if AWS SQS is configured for FIFO; otherwise, false.

Methods

RetrieveMessagesAsync(CancellationToken)

Receive one or more message(s) asynchronous from AWS SQS.

protected virtual IAsyncEnumerable<IMessage<TRequest>> RetrieveMessagesAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The cancellation token of an asynchronous operations.

Returns

IAsyncEnumerable<IMessage<TRequest>>

A task that represents the asynchronous operation. The task result contains a sequence of IMessage<T> whose generic type argument is IRequest.

See Also

IConfigurable<TOptions>