log request before calculating the number

This commit is contained in:
Giuseppe Privitera 2015-08-07 09:41:24 +01:00
parent 4078b3244d
commit 636c23b868

View File

@ -11,10 +11,11 @@ amqp.connect('amqp://localhost', function(err, conn) {
console.log(' [x] Awaiting RPC requests');
ch.consume(q, function reply(msg) {
var n = parseInt(msg.content.toString());
var r = fibonacci(n);
console.log(" [.] fib(%d)", n);
var r = fibonacci(n);
ch.sendToQueue(msg.properties.replyTo,
new Buffer(r.toString()),
{correlationId: msg.properties.correlationId});