1.1.0 • Published 7 years ago

mio-services v1.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

MIO MicroServices Lib

NodeJS microservices with callbacks based on RabbitMQ queues

Quick Start

1) Run RabbitMQ on your machine. You can use docker image for it: docker run d -p 5672:5672 --name rabbitmq rabbitmq 2) Run sample service: node service.js 3) Run sample client: node client.js

HowTo

service(name, amqpServer, cb) - create new microservice

  • name - microservice name
  • amqpServer - if null, than use localhost
  • cb(err, srv) - callback function, where err - error info, srv - object representing service data

srv.listen(CMD, processor) - adding logic for command

  • CMD - command name
  • processor(data, cb) - processing function

client(amqpServer, cb) - create new microservice client for consumer

  • amqpServer - if null, than use localhost
  • cb(err, cli) - callback function, where err - error info, cli - object representing service data

cli.call(serviceName, CMD, data, cb) - execute command at microservice

  • serviceName - microservice name
  • CMD - command name
  • data - JSON data, or null
  • cb(data) - optional callback for result of execution
1.1.0

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago