-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rejectBasic and qosBasic don't work #16
Comments
qosBasic was verified using a locally build kaazing-amqp-0-9-1-client-javascript with the proposed fix. For rejectBasic, when requeue is set to false in the rejectBasic Config: var rejectConfig = {deliveryTag: dt, requeue: false}; The same messages keep getting redelivered to the same client when they shouldn't be. From Shuaib: var handleMessageReceived = function(event) {
receivedMessageCount.text(++receivedMessageCounter);
var body = null;
// Check how the payload was packaged since older browsers like IE7 don't
// support ArrayBuffer. In those cases, a Kaazing ByteBuffer was used instead.
if (typeof(ArrayBuffer) === "undefined") {
body = event.getBodyAsByteBuffer().getString(Charset.UTF8);
}
else {
body = arrayBufferToString(event.getBodyAsArrayBuffer())
}
var props = event.properties;
var exchange = event.args.exchange;
var routingKey = event.args.routingKey;
var dt = event.args.deliveryTag;
var channel = event.target;
logMessageDiv("MESSAGE CONSUMED: ", "receiveMessage", body, props, exchange, routingKey);
// Acknowledge the message as we passed in a false for 'noAck' in the
// AmqpChannel.consumeBasic() call. If the message is not acknowledged,
// the broker will keep holding the message. And, as more and more
// messages are held by the broker, it will eventually result in
// an out of memory error.
var config = {deliveryTag: dt, multiple: true};
setTimeout(function() {
// Acknowledging is a synchronous call with a roundtrip to the server,
// therefore schedule it independently so as not to block current
// execution.
// channel.ackBasic(config);
var rejectConfig = {deliveryTag: dt, requeue: true};
channel.rejectBasic(rejectConfig);
}, 0);
} If requeue is set to false the message is still redelivered, but should not be. |
This issue was moved to kaazing/javascript.client#5 |
rejectBasic() doesn't work because it is in the wrong state array in AmqpClient.js. It is in the array for synchronous methods but it is asynchronous so it throws an error.
qosBasic doesn't work because it is not in any of the state arrays in AmqpClient.js.
I am working on a patch to fix these issues.
The text was updated successfully, but these errors were encountered: