Skip to content

SQS client wrapper #14

@mwarman

Description

@mwarman

Describe the story

Create a SQS client utility which serves as a wrapper around the AWS SDK SQSClient. This should simplify the creation of the AWS SDK SQS client and it should store the created instance as a singleton for reuse across Lambda function invocations.

The wrapper should provide a sendToQueue helper function which publishes a message and attributes, i.e. message attributes, to a SQS queue by the Queue URL.

The wrapper should provide a getter which returns the singleton instance of the SQSClient.

Acceptance criteria

GIVEN the app initializes an instance of the SQS client
WHEN no parameters are supplied to the initializer
THEN an instance of the client is created using the default configuration for the SQSClient

WHEN the SQSClientConfig is provided to the initializer
THEN the SQSClient instance is constructed using the supplied configuration

WHEN the SQSClient instances are constructed
THEN they are cached as singleton instances

GIVEN the sendToQueue function is invoked
WHEN the singleton instance does not exist
THEN a SQSClient instance is constructed with default configuration
AND the instance is cached as the singleton
AND the instance is used by the sendToQueue function

WHEN the singleton instance already exists
THEN the instance is used by the sendToQueue function

Additional context

n/a

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions