0.1.11 • Published 10 years ago

rabbit-pub-sub v0.1.11

Weekly downloads
47
License
-
Repository
-
Last release
10 years ago

rabbit-pub-sub Build Status

A turn key solution for doing pub/sub using rabbitmq.

What is this?

This project was written to try and minimise the friction in getting going with rabbitmq when using a publication/subscription model.

How do I install it?

npm install

You can install this plugin via the node package manager. The --save option will automnatically insert a package entry into you package.json.

npm install rabbit-pub-sub --save

What about the code?

A simple pub sub scenario below. Please make sure you dispose of your connections properly or else they will leak!!

var logger = {
    info: function(str) {
        console.log(str);
    }
};

var config = {
    server: "localhost",
    queue: "rps-queue",
    exchange: "rps-exchange"
};

var rabbit = require("rabbit-pub-sub");

var subscriber = new rabbit.MessageSubscriber(config, logger,
    function(message) {
        subscriber.end();
        done();
    });

new rabbit.MessagePublisher(config, logger, function(publisher) {
    publisher.publish({
        name: "fir3pho3nixx",
        email: "fir3pho3nixx@gmail.com"
    });
    publisher.end();
});
0.1.11

10 years ago

0.1.10

10 years ago

0.1.9

11 years ago

0.0.8

11 years ago

0.0.7

11 years ago

0.0.6

11 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago