Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@pager/minion-army

pagerinc1.1kMIT2.3.0

Microservice Framework for RabbitMQ Workers

minion, microservices, worker, rabbitmq, framework

readme

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

changelog

2.3.0 (2025-05-22)

Features

  • RAG-1540: support newrelic 12 and resolve vulnerabilities (#461) (daab112)

2.2.1 (2024-03-20)

Bug Fixes

2.2.0 (2024-03-20)

Features

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

2.1.0 (2023-05-08)

Features

2.0.0 (2020-08-19)

Bug Fixes

  • update deps, move from @hapi/joi to joi (#234) (fad00f6)

BREAKING CHANGES

  • using joi instead of @hapi/joi

1.3.0 (2020-07-17)

Features

1.2.0 (2020-05-13)

Features

1.1.8 (2020-03-21)

Bug Fixes

1.1.7 (2020-03-19)

Bug Fixes

1.1.6 (2020-03-09)

1.1.5 (2020-03-07)

1.1.4 (2020-03-06)

1.1.3 (2020-03-05)

Bug Fixes

  • github: add semantic-release cache support [UE-910] (#128) (01447f5)

1.1.2 (2020-03-05)