How to solve "PRECONDITION_FAILED - delivery acknowledgement on channel 1 timed out. " error in rabbitmq javascript without changing rabbitmq configuration files

3,223 views
Skip to first unread message

Fadime Ozdemir

unread,
Dec 15, 2022, 1:38:04 AM12/15/22
to rabbitmq-users

After 30 minute I get this error:

Channel closed by server: 406 (PRECONDITION-FAILED) with message "PRECONDITION_FAILED - delivery acknowledgement on channel 1 timed out. Timeout value used: 1800000 ms. This timeout value can be configured, see consumers doc guide to learn more"

I read online that this error is generated because the consumer does not acknowledge the message but I put noAck:false so it should acknowledge the message automatically, also in the queue I can see it has been unacked from rabbitmq manager.

 So why am I getting this error? How can I solve this? From what is come from?

this is how my queues look like:   Screenshot from 2022-12-13 13-45-05.pnghere is the code for the consumer:

const channel = await connection.createChannel();
await channel.assertExchange(exchange, exchangeType, { durable: true });
const assertedQueue = await channel.assertQueue('', { exclusive: true, });
await channel.bindQueue(assertedQueue.queue, exchange, routingKey);

await channel.consume(assertedQueue.queue, msg => dbOperation(msg, channel), { noAck: false, // send always an answer of confirmation back }); 
 });
How can I solve this? why is this happening??

David Brown

unread,
Dec 30, 2022, 1:39:39 PM12/30/22
to rabbitmq-users
I believe `noAck: false` means the server will expect you to manually `channel.ack(msg)` the message. If you don't ack it then it will eventually timeout.

You could either ack the message or set `noAck: true`.

It's confusing because it is a double negative. But I think I have that right. :)
Reply all
Reply to author
Forward
0 new messages