1.0.0 • Published 9 years ago

follow-to-amqp v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

follow-to-amqp

Listens to a CouchDB database changes "feed" and then publish the changed documents to a AMQP exchange

Usage:

var followToAMQP = require('follow-to-amqp');

followToAMQP(
	// CouchDB Configuration
	// For more info see: https://npmjs.org/package/follow
	{
		db: 'http://127.0.0.1:5984/test-db',
		filter: function (doc, req) {
			return doc.type || doc._deleted;
		}
	},
	// AMQP Configuration
	// For more info see: https://npmjs.org/package/amqp
	{
		host	: 'localhost',
		exchange: 'couch-changes'
	},
	// Formatter function, this is the default 
	function (doc) {
		return {
			name: doc._id,
			body: JSON.stringify(doc),
			options: {
				contentType: 'application/json'
			}
		};
	}
);
1.0.0

9 years ago

0.0.1

11 years ago

0.0.0

11 years ago