rabbitmq-boilerplate

1.0.9 • Public • Published
const Rabbitmq = require("./index.js"),  
    async = require("async");
 
const rabbitmq = new Rabbitmq();
 
//can be hot-swapped
rabbitmq.config("amqp://localhost");
 
rabbitmq.send({"value": Math.random()}, "queuename", (err) => {
    if (err){
        return console.error(err)
    }
    console.log("sended")
});
 
rabbitmq.listen("queuename", (err, msg) => {
    if (err) {
        return console.error("you should call rabbitmq.listen again", err.toString())
    }
    console.log("received", msg.payload);
    msg.release(); //or msg.reject();
});
 

/rabbitmq-boilerplate/

    Package Sidebar

    Install

    npm i rabbitmq-boilerplate

    Weekly Downloads

    0

    Version

    1.0.9

    License

    ISC

    Unpacked Size

    54 kB

    Total Files

    11

    Last publish

    Collaborators

    • landgraf_paul