Microcore.js
Microcore.js is a library for simple creation of pipelinening microservices in Node.js with RabbitMQ.
Installation
npm install --save microcore
Requirements
Since Microcore.js is written in ES6 and it uses async/await - it requires latest stable node (7.x or later).
Features
- Simple interface for building pipelinening (micro)services
- Easy way to scale services both horizontally (by adding more nodes) and vertically (by adding more subscribers)
Usage
Quick start
Example service that subscribe to messages from helloworld
topic and does some work with incoming data (in this case it just appends world!
to incoming string):
const createService = ; // service configconst serviceConfig = ID: 'helloworld' type: 'servicetype' rabbit: host: 'rabbit' exchange: 'exchange' statusReportInterval: 60000 resultKey: 'responsekey'; // creating service will return shutdown functionconst shutdown = await ;
Example service that sends messages to helloworld
and logs response to console:
const Microwork = ; // create masterconst master = host: 'rabbit' exchange: 'exchange';// listen for reply from workersawait master;// send message to workersawait master;