SQS-DQ-v0
A thing for dequeue-ing messages from AWS SQS and giving those messages to a worker function
REALLY ALPHA QUALITY - API may change
Doesn't:
- change message visbility window if worker holds onto message for too long
- handle more than one queue
- shutdown very gracefully
- have any tests yet (verified working only via some hacky integration tests on my laptop)
Does:
- Expect SNS delivered messages to be in RAW format
- probably have bugs + race conditions
- batch up fetching and deleting messages
- need more internal operations visibilty
Other Problems:
- Concurrency is limited to 10... (because coupling between max SQS batch size and max concurrent workers) (fixable)
Usage
var DeQueue = ; var opts = "aws": "accessKeyId": "XXXXXXXXXXXXXXXXXXX" "secretAccessKey": "YYYYYYYYYYYYYYYYYYYYYYYYY" "region": "eu-west-1" "concurrency": 10 //optional; var { console; ;} var datQueueProcessor = "https://sqs.eu-west-1.amazonaws.com/312010819855/my-queue" opts myWorker ; //Emitted if any error during fetch loopdatQueueProcessor; //Emitted if any error during reap loopdatQueueProcessor; //Emitted if any error during message deletiondatQueueProcessor; datQueueProcessorstartmyWorker;