- 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:
InvalidConfigExceptionWhen 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. |
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:
NotAnEventSourceMappingEventExceptionWhen 'Records' is missing or null in the event.EventHandlerNotFoundForTypeExceptionWhen an event handler is not found for a message type.MessageProcessingFailedExceptionWhen 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. |