Socket
Book a DemoInstallSign in
Socket

@splitmedialabs/node-queue-processor

Package Overview
Dependencies
Maintainers
4
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@splitmedialabs/node-queue-processor

Built on NodeJS. This application will process queue messages.

1.0.10
latest
Source
npmnpm
Version published
Weekly downloads
29
7.41%
Maintainers
4
Weekly downloads
 
Created
Source

Queue Processor

Built on NodeJS. This application will process queue messages.

Features

  • Use different queues
  • Rate limit work process

Supported Queues

  • Google Pub/Sub
  • AWS SNS
  • RabbitMQ soon

Sample Code

const { Manager, Worker, RateLimit } = require('node-queue-processor');
const config = require('../config');

// AWS SQS
const Queue = new AwsSqsQueue(
    {
        access_key: config.accessKey,
        secret_access_key: config.secretAccessKey,
    },
    config.queueUrl
);

// OR Google Pub/Sub
const Queue = new GooglePubsubQueue(
    config.projectId,
    config.keyfile,
    config.subscription,
    config.topic
);

async function main() {
    
    const manager = new Manager(Queue);
    const worker = new Worker(async (data) => {
        console.log(data);
        return 'done';
    }, new RateLimit({
        process_per_period: 5, // 5 requests
        period: 60, // per 60 seconds
    }, {
        id: 'test',
        redisConnection: {
            host: '127.0.0.1',
            port: 6379
        }
    }));

    // attach handlers
    manager.attachWorker('sample-handler', worker);

    manager.start();
}

main();

Sample Message

Message body:

{
  "hello": "world"
}

Message attributes:

{
  "type": "sample-handler"
}

Keywords

sqs

FAQs

Package last updated on 03 Jun 2025

Did you know?

Socket

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.