0.1.3 • Published 10 years ago

antenna-amqp v0.1.3

Weekly downloads
2
License
-
Repository
github
Last release
10 years ago

antenna-amqp

Build Coverage Quality Dependencies Tips

This module provides an AMQP 0-9-1 adapter for Antenna. AMQP 0-9-1 is implemented by popular messages brokers such as RabbitMQ.

Install

$ npm install antenna-amqp

Usage

Connect to Message Bus

var amqp = require('antenna-amqp');
var bus = new amqp.Bus();

bus.connect({ host: 'localhost', port: 5672 }, function() {
  console.log('connected!');
});

Dispatch Messages to Application

var antenna = require('antenna');
var app = antenna();

bus.on('message', app);

bus.subscribe('events/on', function(err) {
  if (err) { throw err; }
  console.log('subscribed to topic!');
});

Publish Messages

bus.publish('events/on', { time: Date.now() }, function(err) {
  if (err) { throw err; }
  console.log('published message!');
});

Tests

$ npm install
$ make test

Credits

License

The MIT License

Copyright (c) 2014 Jared Hanson [http://jaredhanson.net/](http://jaredhanson.net/)

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago