sqs-huge-message
A service to send and receive huge (and not huge) payload to SQS with Lambda.
How it works
"A picture is worth a thousand words", said a painter, then check this out this nice and emoji flow picture below.
Nice, isn't, but we have a explanation in words too: AWS Node SDK has a little anoing particularity about size of messages, sometimes we need send a huge message payload to SQS, but the AWS SQS has a limit of 256kb (
Instalation
npm install sqs-huge-message
Usage
Initialize
import { SqsService } from './sqs-huge-msg';
const sqsOptions = {
endpoint: ENDPOINT_SQS,
region: REGION,
queueName: QUEUE_NAME,
s3EndpointUrl: ENDPOINT_S3,
s3Bucket: BUCKET_NAME,
}
const sqsService = new SqsService(sqsOptions);
Send Message
import { SqsService } from './sqs-huge-msg';
const payload = await sqsService.sendMessage(sqsOptions.queueName, message);
Receive Message
import { SqsService } from './sqs-huge-msg';
const message = await sqsService.getMessage(sqsOptions.queueName);
More info
I based my project on this awesome project: https://github.com/aspecto-io/sns-sqs-big-payload This project works very well, but doesn't work with AWS Lambda.