AMQP driven micro services for node.
This library aims to simplify building queue based services in nodejs using AMQP. It simplifies getting started and provides some out of the box monitoring / admin for these services.
Don't use it in production, early adopters and hackers are welcome, the API is still in a state of flux as we work on evolving some of the core features.
To build a new service we just create the service and pass in our handler(s).
var svcs = require'svcs';var container = svcs;// override the default amqpUrlvar amqpUrl = processenvAMQP_URL || configamqpurl;containerset'amqpUrl' amqpUrl;console.warn'error processing message' err;// add a route which will process messages for the given routing key// the attribute :gatewayId will be replaced with * when passed to bindQueuecontainerroute'$gw.:gatewayId.events' queue: 'gw_events' errorHandler: onErrvar gatewayId = msgparamsgatewayId;;
There are a couple of modules which can be added to the container.
This is a simple JSON decoder which will convert the payload of the incoming AMQP messages to JSON when the messages
contentType is set to
This will send per
routingKey statistics to a statsd server using the
Copyright (c) 2013 Mark Wolfe released under the MIT license.