Closed gideonairex closed 8 years ago
Can you post your test code? I'm using Rabbus w/ Wacally v0.2.2 and am not seeing this issue. There may be something I'm doing that I don't realize, or perhaps it's a timing thing with connection being closed prior to the message making it through the exchange? Sample code to reproduce the issue would help a lot.
Here are my codes. I am using the Request-Reponse pattern.
'use strict';
var util = require( 'util' );
var Rabbit = require( 'wascally' );
var Rabbus = require( 'rabbus' );
Rabbit.configure( {
'connection' : {
'server' : 'localhost',
'port' : 15672,
'vhost' : '/',
'user' : 'guest',
'pass' : 'guest'
}
} ).then ( function () {
function Requester ( rabbus ){
Rabbus.Requester.call( this, rabbus, {
exchange : 'req-res.testing-exchange',
messageType : 'req-res.v1.testing.test'
} );
}
util.inherits( Requester, Rabbus.Requester );
var requester = new Requester( Rabbit );
var msg = {
'message' : 'This is a message'
};
requester.request( msg, function( response, done ){
console.log( arguments );
console.log( response );
done();
// done is not present on the arguments
} );
} );
'use strict';
var util = require( 'util' );
var Rabbit = require( 'wascally' );
var Rabbus = require( 'rabbus' );
Rabbit.configure( {
'connection' : {
'server' : 'localhost',
'port' : 15672,
'vhost' : '/',
'user' : 'guest',
'pass' : 'guest'
}
} ).then ( function () {
function Responder ( rabbus ){
Rabbus.Responder.call( this, rabbus, {
exchange : "req-res.testing-exchange",
messageType : "req-res.v1.testing.test",
queue : "req-res.testing-queue"
} );
}
util.inherits( Responder, Rabbus.Responder );
var responder = new Responder( Rabbit );
responder.handle( function ( message, reply ){
console.log( arguments );
console.log( message );
reply( {
'message' : 'I got this'
} );
} );
} );
Running on non-working environment it results to the following:
It does not acknowledge the message and done is not present on the callback of the requester. I checked your Rabbus library code and even if I put a message.ack() or even with the forceAck option it still doesn't acknowledge those messages. I found it when I was benchmarking my node using ab and noticed that it doesn't acknowledge those messages. It results to crashing the rabbitmq with increasing memory usage. I also waited maybe it was just delayed acknowledgement but still didnt acknowledge it.
Running on working environment it results to the following:
It works when I changed the version of wascally to v0.2.0-8
Hi, Try without this one: requester.request(msg, function (response) { console.log("Hello", response.place); });
the promise is rejected because of done being undefined and the ack is indeed not done.
this should be resolved by now, with newer wascally and rabbus releases
I have tested rabbus and wascally using the latest version which is v0.2.2 then I found out that it doesnt acknowledge messages. But it works on v0.2.0-8. I I think there is something wrong with the new wascally version or are there changes that needs to changed on rabbus?