Open klongmitre opened 5 years ago
By default, messages are automatically acknowledged when you read them.
You can use ack: 'client-individual'
in the subscribe options if you want to manually ack
I confirm that using this headers:
// subscribe to queue
client.subscribe({
'destination': '/queue/test1',
// ack mode
// ack:client-individual: manually send ack / nack
// ack:client-auto: do not send ack / nack
// ack:client:
'ack': 'client-individual'
}, function (error, message) {
it works as expected when then validating the message and sending
// validate this message
if(isMessageOk) {
client.ack(message);
} else {
client.nack(message);
}
Looking at the documentation for the
Client
:In implementation it seems that while not reading a message will delay delivery of new messages, client acks/nacks do not. If the the message is read, it seems that a
client.ack(message)
orclient.nack(message)
does not change whether new messages are received by the client.Is this the expected behavior?