Commit dc7bfbd1 authored by Kamron Aroonrua's avatar Kamron Aroonrua 💬

inc prefetch size

parent ddc524b8
...@@ -26,6 +26,7 @@ function RPCCaller(config) ...@@ -26,6 +26,7 @@ function RPCCaller(config)
ch.responseEmitter = new EventEmitter(); ch.responseEmitter = new EventEmitter();
ch.responseEmitter.setMaxListeners(0); ch.responseEmitter.setMaxListeners(0);
ch.prefetch(4);
ch.consume(REPLY_QUEUE , ch.consume(REPLY_QUEUE ,
(msg) => { ch.responseEmitter.emit(msg.properties.correlationId, JSON.parse(msg.content.toString()))}, (msg) => { ch.responseEmitter.emit(msg.properties.correlationId, JSON.parse(msg.content.toString()))},
{noAck: true}); {noAck: true});
......
...@@ -23,7 +23,7 @@ RPCServer.prototype.start = function(cb) ...@@ -23,7 +23,7 @@ RPCServer.prototype.start = function(cb)
var q = self.name; var q = self.name;
ch.assertQueue(q, {durable: false}); ch.assertQueue(q, {durable: false});
ch.prefetch(1); ch.prefetch(4);
//console.log(' [x] Awaiting RPC requests'); //console.log(' [x] Awaiting RPC requests');
ch.consume(q, function reply(msg) { ch.consume(q, function reply(msg) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment