Comparing version 1.0.3 to 1.1.0
@@ -12,3 +12,5 @@ var comb = require("comb"), | ||
constructor: function (rpcQueue, createQueue, createExchange) { | ||
this.recieveQueue = createQueue().exclusive(true); | ||
// specify a name for the reply queue so the name remains the same if amqp reconnects to rabbit | ||
var recieveQueueName = rpcQueue.queueName + '-rpc-reply-' + uuid.v4(); | ||
this.recieveQueue = createQueue(recieveQueueName).exclusive(true); | ||
this.rpcQueue = rpcQueue; | ||
@@ -15,0 +17,0 @@ this.createExchange = createExchange; |
{ | ||
"name": "hare", | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"description": "Wrapper around amqp to make common patterns easier", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -155,3 +155,4 @@ "use strict" | ||
it.should("allow the creation of an rpc client", function () { | ||
return hare().rpc("rpc_queue").handle(function () { | ||
var rpc = hare().rpc("rpc_queue") | ||
return rpc.handle(function () { | ||
}).chain(function () { | ||
@@ -168,2 +169,6 @@ assert.equal(connection.getCallCount("queue"), 1); | ||
assert.isTrue(queue.calledWith("bind", ["amq.direct", undefined])); | ||
// the queue for replies should have the rpc queue name and a uuid for uniqueness | ||
// e.g. rpc_queue-rpc-reply-DE13492E-337F-454C-8BA6-CFD18ED99E09 | ||
assert.isTrue(rpc.recieveQueue.queueName.startsWith("rpc_queue-rpc-reply-")); | ||
assert.equal(rpc.recieveQueue.queueName.length, 56); | ||
}); | ||
@@ -170,0 +175,0 @@ }); |
48954
990