minion-army
Microservice Framework for RabbitMQ Workers
usage
const Army = require('@pager/minion-army');
const Joi = require('@hapi/joi');
const manifest = {
connection: {
rabbitUrl: 'amqp://localhost'
},
defaults: {
exchangeName: 'my-exchange-name'
},
workers: [
{
handler: (message) => console.log('my job is to log this', message),
config: {
name: 'jobs.logging',
key: 'events.something.happened'
},
validate: Joi.object({
id: Joi.string().required()
})
},
{
handler: (message) => true,
config: {
name: `jobs.trueing`,
key: `events.something.happened`
}
}
]
};
const army = Army(manifest);
army.start();