Comparing version 1.4.1 to 1.4.2
10
index.js
@@ -30,3 +30,3 @@ 'use strict' | ||
this._work_channel = null | ||
this._exchange = opts.exchange || null | ||
this._exchange = opts.exchange || 'remit' | ||
@@ -85,3 +85,3 @@ // Callback queues | ||
self.__use_consume_channel(() => { | ||
self._consume_channel.bindQueue(chosen_queue, 'remit', event).then(() => { | ||
self._consume_channel.bindQueue(chosen_queue, self._exchange, event).then(() => { | ||
self._consume_channel.consume(chosen_queue, (message) => { | ||
@@ -136,3 +136,3 @@ if (!message.properties.timestamp) { | ||
return self.__use_publish_channel(() => { | ||
self._publish_channel.publish('remit', event, new Buffer(JSON.stringify(args || {})), options) | ||
self._publish_channel.publish(self._exchange, event, new Buffer(JSON.stringify(args || {})), options) | ||
}) | ||
@@ -194,3 +194,3 @@ } | ||
self.__use_publish_channel(() => { | ||
self._publish_channel.publish('remit', event, new Buffer(JSON.stringify(args || {})), options) | ||
self._publish_channel.publish(self._exchange, event, new Buffer(JSON.stringify(args || {})), options) | ||
}) | ||
@@ -579,3 +579,3 @@ } | ||
self.__use_work_channel(() => { | ||
self._work_channel.assertExchange('remit', 'topic', { | ||
self._work_channel.assertExchange(self._exchange, 'topic', { | ||
autoDelete: true | ||
@@ -582,0 +582,0 @@ }).then(() => { |
{ | ||
"name": "remit", | ||
"version": "1.4.1", | ||
"version": "1.4.2", | ||
"description": "A small set of functionality used to create microservices that don't need to be aware of one-another's existence.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -10,28 +10,6 @@ 'use strict' | ||
// remit.res('test.replies', [ | ||
// (args, done, extra) => { | ||
// console.log('Adding to', args) | ||
// args.password = 'sdlfiughsdiouhgbe7' | ||
// return done(null, args) | ||
// }, | ||
// (args, done) => { | ||
// console.log('Got a hit...', args, '...replying.') | ||
// throw new Error('Dummy') | ||
// return done(null, 'here is the reply') | ||
// } | ||
// ]) | ||
remit.res('test.replies', (args, done) => { | ||
console.log('Got a hit...', args, '...replying.') | ||
// throw new Error('Dummy') | ||
return done(null, 'here is the reply') | ||
}) |
@@ -8,8 +8,2 @@ 'use strict' | ||
// const log = require('remit-bunyan')('test-service', remit) | ||
// setTimeout(function () { | ||
// throw new Error('Balls') | ||
// }, 2000) | ||
console.log('Okay') | ||
@@ -19,4 +13,2 @@ | ||
username: 'jack' | ||
}, (err, data) => { | ||
console.log(err, data) | ||
}) |
7
41788
635
3