Socket
Socket
Sign inDemoInstall

@pager/minion-army

Package Overview
Dependencies
185
Maintainers
69
Versions
33
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @pager/minion-army

Microservice Framework for RabbitMQ Workers


Version published
Weekly downloads
825
decreased by-38.11%
Maintainers
69
Created
Weekly downloads
 

Changelog

Source

2.2.1 (2024-03-20)

Bug Fixes

  • ODIN-13: patch version bump (#459) (70a1bc2)

Features

  • ODIN-13: set NR transaction name based on worker name (#458) (b0bb358)

Readme

Source

minion-army

Microservice Framework for RabbitMQ Workers

usage

const Army = require('@pager/minion-army');
const Joi = require('joi');

// Refer to lib/schema.js to see valid options
const manifest = {
    connection: { // optional, if not provided will default to a rabbit connection to local host
        rabbitUrl: 'amqp://localhost'
    },
    defaults: { // default values that apply for all workers
        exchangeName: 'my-exchange-name'
    },
    workers: [
        {
            handler: (message) => console.log('my job is to log this', message),
            config: { // same config as expected by minions
                name: 'jobs.logging',
                key: 'events.something.happened'
            },
            validate: Joi.object({ // set a joi schema to validate handler input (optional)
                id: Joi.string().required()
            })
        },
        {
            handler: (message) => true,
            config: {
                name: `jobs.trueing`,
                key:  `events.something.happened`
            }
        }
    ]
};

const army = Army(manifest);

army.start(); // if you provide defaults.autoStart = true this is not needed

Keywords

FAQs

Last updated on 20 Mar 2024

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