‚̧Neighbour Problem Manager
    Wondering what‚Äôs next for npm?Check out our public roadmap! ¬Ľ

    rabbity

    0.0.2¬†‚Äʬ†Public¬†‚Äʬ†Published

    A simple wrapper for rabbitmq. Handles JSON payloads.

    // config = {
    //   rxURL: 'amqp://localhost',
    //   txURL: 'amqp://localhost',
    //   url: 'amqp://localhost',
    //   logger: console // or something
    // }
    var RabbitMQ = require('rabbity')(config)
     
    // options
    // * useRXURL: bool
    var producer = RabbitMQ('some-channel-name', {options})
    producer.connect().then(function () {
      console.log('sending');
      return producer.send({a: 'b', c: 1})
    }).catch((e) => {
      console.log(e)
    })
     
    // RX URL is optimized for
    var consumer = RabbitMQ('some-channel-name', {useRXURL: true})
    consumer.connect().then(function () {
      consumer.consume(function (message, json) {
        console.info('Message received:', json);
        consumer.ack(message)
      });
    })

    Keywords

    none

    Install

    npm i rabbity

    DownloadsWeekly Downloads

    3

    Version

    0.0.2

    License

    MIT

    Last publish

    Collaborators

    • avatar
    • avatar