Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

svcs

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svcs

AMQP driven micro services for node.

  • 0.1.12
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

svcs Build Status

NPM NPM

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.

Status

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.

API

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 amqpUrl
container.set('amqpUrl', 'amqp://guest:guest@rabbitmq.example.com:5672');

// add a route which will process messages for the given routing key
// the attribute :gatewayId will be replaced with * when passed to bindQueue
container.route('$gw.:gatewayId.events', {queue: 'gw_events'}, function handler(err, msg){
    var gatewayId = msg.params.gatewayId;
}

Middleware

There are a couple of modules which can be added to the container.

JSON

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 application/json.

container.use(svcs.json());

Routing Statistics

This will send per routingKey statistics to a statsd server using the increment function.

container.use(svcs.stats());

TODO

  • Add locals to enable connection pools to be tied in and available to the msg, this probably should be done by a middleware module later.
  • Need to rework configuration and decide where the defaults should live.
  • Need to review jobs as the api is pretty average at the moment.
  • More testing..

License

Copyright (c) 2013 Mark Wolfe released under the MIT license.

Keywords

FAQs

Package last updated on 17 Mar 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc