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

amqp-pool

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amqp-pool

Go swimming in the AMQP Pool

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

AMQP Pool

Create sets of AMQP consumers and publishers. JSON messages are routed using (mustache) routing key templates, which are filled by the messages themselves.

NOTE: this API is very much under development and will probably change.

Installation

npm install amqp-pool

Basic Usage

Create a specification of how you will consume and publish messages. Then call this library to get started.

var mq = require("amqp-pool")({
  server: "amqp://guest:guest@localhost"
  ,publishers: {
    life: "{kingdom}/{phylum}.{class}.{order}.{family}.{genus}.{species}"
  }
  ,consumers: {
    nutty: {
      routes: "Plants/#.Fagales.Fagaceae.#/#.Fagales.Betulaceae.#"
      ,method: function(msg){ console.log(msg); this.ack(msg) }
    }
    ,pears: {
      routes: [""]
      ,method: function(msg) { this.ack(msg); }
    }
  }
}).activate().then(function(){
  // now consuming and ready to publish
  mq.life.publish({
    kingdom: "Animalia"
    ,phylum: "Chordata"
    ,class: "Mammalia"
    ,order: "Primates"
    ,family: "Hominadae"
    ,genus: "Homo"
    ,species: "sapiens"
  })
}).catch(function(e){
  // OUCH, could NOT connect
})

Keywords

FAQs

Package last updated on 09 Oct 2015

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