Skip to content

Latest commit

 

History

History
50 lines (36 loc) · 2.2 KB

reference.md

File metadata and controls

50 lines (36 loc) · 2.2 KB

Functions

createSQSConsumer([config])consumer

Creates a consumer function that processes messages from an SQS event source mapping, following the provided configuration.

consumer(lambdaEvent)Promise.<void>

An async function that processes messages from an AWS Lambda event, based on the provided configuration.

createSQSConsumer([config]) ⇒ consumer

Creates a consumer function that processes messages from an SQS event source mapping, following the provided configuration.

Kind: global function
Returns: consumer - An async function that processes messages from an AWS Lambda event.
Throws:

  • InvalidConfigException When the provided configuration fails schema validation.
Param Type Default Description
[config] Object {} The configuration object for the consumer.
config.events Object An object mapping event types to event handling manifests.
[config.persistence] Object An optional persistence object for storing message processing state.

consumer(lambdaEvent) ⇒ Promise.<void>

An async function that processes messages from an AWS Lambda event, based on the provided configuration.

Kind: global function
Returns: Promise.<void> - A promise that resolves after processing all messages.
Throws:

  • NotAnEventSourceMappingEventException When 'Records' is missing or null in the event.
  • EventHandlerNotFoundForTypeException When an event handler is not found for a message type.
  • MessageProcessingFailedException When message processing encounters an exception.
Param Type Description
lambdaEvent Object The Lambda event containing the SQS messages to process.
lambdaEvent.Records Array An array of message records.