Class ALambdaQueueFunction<TMessage>
The ALambdaQueueFunction<TMessage> is the abstract base class for handling Amazon Simple Queue Service (SQS) events.
Implements
Inherited Members
Namespace: LambdaSharp.SimpleQueueService
Assembly: LambdaSharp.SimpleQueueService.dll
Syntax
public abstract class ALambdaQueueFunction<TMessage> : ALambdaFunction, ILambdaSharpLogger
Type Parameters
Name | Description |
---|---|
TMessage | The SQS queue message type. |
Remarks
When the Lambda function is declared with a Dead-Letter Queue (DLQ), the function attempts a
failed message up to 3 times, by default. The default can be overridden by setting a different
value for the MAX_QUEUE_RETRIES
environment variable. Without a DLQ, the function will
attempt a message indefinitely.
Constructors
ALambdaQueueFunction(ILambdaJsonSerializer)
Initializes a new ALambdaQueueFunction<TMessage> instance using the default
implementation of ILambda
Declaration
protected ALambdaQueueFunction(ILambdaJsonSerializer serializer)
Parameters
Type | Name | Description |
---|---|---|
ILambda |
serializer | Custom implementation of ILambda |
ALambdaQueueFunction(ILambdaJsonSerializer, ILambdaQueueFunctionDependencyProvider)
Initializes a new ALambdaQueueFunction<TMessage> instance using a
custom implementation of ILambda
Declaration
protected ALambdaQueueFunction(ILambdaJsonSerializer serializer, ILambdaQueueFunctionDependencyProvider provider)
Parameters
Type | Name | Description |
---|---|---|
ILambda |
serializer | Custom implementation of ILambda |
ILambda |
provider | Custom implementation of ILambda |
Properties
CurrentRecord
The Current
Declaration
protected SQSEvent.SQSMessage CurrentRecord { get; }
Property Value
Type | Description |
---|---|
Amazon. |
The Amazon. |
Remarks
This property is only set during the invocation of Processnull
.
LambdaSerializer
An instance of ILambda
Declaration
protected ILambdaJsonSerializer LambdaSerializer { get; }
Property Value
Type | Description |
---|---|
ILambda |
The ILambda |
Provider
The ILambda
Declaration
protected ILambdaQueueFunctionDependencyProvider Provider { get; }
Property Value
Type | Description |
---|---|
ILambda |
The ILambda |
Methods
Deserialize(String)
The Deserialize(String) method converts the SQS queue message from string to a typed instance.
Declaration
public virtual TMessage Deserialize(string body)
Parameters
Type | Name | Description |
---|---|---|
System. |
body | The SQS queue message. |
Returns
Type | Description |
---|---|
TMessage | The deserialized SQS queue message. |
Remarks
This method invokes Amazon.
ProcessMessageAsync(TMessage)
The Process
Declaration
public abstract Task ProcessMessageAsync(TMessage message)
Parameters
Type | Name | Description |
---|---|---|
TMessage | message | The deserialized SQS queue message. |
Returns
Type | Description |
---|---|
System. |
The task object representing the asynchronous operation. |
ProcessMessageStreamAsync(Stream)
The Process
Declaration
public sealed override async Task<Stream> ProcessMessageStreamAsync(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System. |
stream | The stream with the request payload. |
Returns
Type | Description |
---|---|
System. |
The task object representing the asynchronous operation. |
Overrides
Remarks
This method cannot be overridden.