minion-army
Microservice Framework for RabbitMQ Workers
usage
const Army = require('@pager/minion-army');
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();