1.1.7 • Published 6 years ago

qtort-microservices v1.1.7

Weekly downloads
57
License
-
Repository
github
Last release
6 years ago

qtort-microservices

A simple micro-services framework for Node.js. Includes the functionality previously provided by the microservice-crutch module for jump-starting The implementation of a micro-service.

Documentation

For the moment, see the files in the examples/ directory for usage.

microservice-crutch

Provides a jump-start on implementing a micro-service compatible with micro-services using AMQP and the qtort-microservices module.

This is a fork of the open-source project microservice-crutch that I started while at Influence Health. You can check out their fork at https://github.com/medseek-engineering/microservice-crutch.

Prerequisites

You must have RabbitMQ installed and working. You can pass the location of the RabbitMQ server on the command line when starting your process like this:

node myapp.js --broker=amqp://username:password@host:port/vhost

If you do not specify the location of RabbitMQ, the default of amqp://guest:guest@localhost:5672/ is used instead.

Usage

Quick Start

npm install qtort-microservices
var crutch = require('qtort-microservices').crutch;
crutch({ /*default options*/ }, function(app, microservices, options, Promise) {
    return microservices.bind('topic://exchangeName/routingKey/queueName', function(mc) {
        return Promise.try(function() {
            return { receivedBody: mc.deserialize() };
        }).catch(function(error) {
            return { error: error };
        });
    });
});

Examples

See the examples for a ping sender and listener that illustrates the most common usage.

First, clone the Github repository for qtort-microservices, and npm install.

Start the ping listener first, then the ping sender.

git clone https://github.com/fwestrom/qtort-microservices.git
cd qtort-microservices
npm install
node examples/crutch-ping-listener.js
node examples/crutch-ping-sender.js
1.1.7

6 years ago

1.1.6

7 years ago

1.1.5

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago