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
TRequestThe 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
marshallerIMarshallerThe IMarshaller that is used when converting models to messages.
optionsAmazonMessageOptionsThe AmazonMessageOptions used to configure this instance.
Exceptions
- ArgumentNullException
marshallercannot be null -or-optionscannot be null.- ArgumentException
optionsare not in a valid state.
Fields
MessageTypeAttributeKey
The key for the message type attribute.
protected const string MessageTypeAttributeKey = "type"
Field Value
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
trueif 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
cancellationTokenCancellationTokenThe 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.