Socket
Socket
Sign inDemoInstall

queue-processor

Package Overview
Dependencies
39
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    queue-processor

Processes an AWS SQS queue


Version published
Weekly downloads
309
decreased by-40.69%
Maintainers
1
Install size
86.0 MB
Created
Weekly downloads
 

Readme

Source

queue-processor

Consume SQS messages and do something to them, with the SQS message passed in to your processing function as the first param and a complete callback as the second. The message will be deleted from SQS when the complete callback is called. If you pass an error / anything to the complete callback the message will be preserved unless deleteOnError is truthy.

Usage


var queueProcessor = require('queue-processor'),
    config = {
        accessKeyId: 'xxxxxxxxxx', // required
        secretAccessKey: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', // required
        region: 'ap-southeast-2', // required
        queueUrl: 'https://sqs.ap-southeast-2.amazonaws.com/1234/test-queue', // required
        deleteOnError: true/false // optional
    };

function mySweetMessageHandler(message, callback) {
    doStuffToMessage(message, function(error) {
        if (error) {
            return callback(error);
        }

        callback();
    });
}

queueProcessor(config, mySweetMessageHandler);

Also takes an optional logger as the second param. e.g queueProcessor(config, logger, mySweetMessageHandler)

Keywords

FAQs

Last updated on 23 Mar 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc