Understanding consumer-timeout behaviour

70 views
Skip to first unread message

Gary

unread,
Jun 30, 2026, 4:53:45 PMJun 30
to rabbitmq-users
Using RabbitMQ v3.13.7 in a Docker container I am trying to understand how queues configured with a consumer-timeout behave if a message is NOT acknowledged within the timeout. From the docs, "if a consumer does not ack its delivery within the timeout value its channel is closed ... with a channel exception".

Using either a classic or quorum durable queue, configured with x-consumer-timeout set during creation via the management console (and confirmed via the management console it is configured so), I ran a simple Spring Boot rabbit listener configured to MANUALLY acknowledge messages. What I found was that the message remained unacknowledged beyond the queue consumer-timeout value as shown in the management console, no exception was thrown and the message was not automatically dead-lettered/discarded/re-queued. I repeated the same test with a Python application also  configured to manually acknowledge messages. The result was the same. I could only get the message to be re-queued if I stopped either application.

The Spring application:
@SpringBootApplication
public class RabbitMQMinimalApplication {
    static void main(String[] args) {
        SpringApplication.run(RabbitMQMinimalApplication.class, args);
    }

    @RabbitListener(queues = "incomingQueue")
    public void listen(String in)  {
        log.info(in);
    }
}

Its configuration:
spring.rabbitmq.listener.simple.acknowledge-mode=manual
spring.rabbitmq.listener.direct.acknowledge-mode=manual

The python application:
import pika

def callback(ch, method, properties, body):
    print(f" [x] Received {body}")

if __name__ == '__main__':
    connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
    channel = connection.channel()
    channel.basic_consume(queue='incomingQueue', on_message_callback=callback, auto_ack=False)
    print(' [*] Waiting for messages. To exit press CTRL+C')
    channel.start_consuming()

It appears that consumer-timeouts are not working as per the documentation. Could anyone confirm this?

Thanks
Gary


jo...@cloudamqp.com

unread,
Jul 6, 2026, 11:36:18 AMJul 6
to rabbitmq-users

Hi,
Test it with the latest version (4.3.2). 3.13.7 is out of community support since a long time.

/Johan

jo...@cloudamqp.com

unread,
Jul 10, 2026, 6:11:03 PM (13 days ago) Jul 10
to rabbitmq-users
Actually don't try it with 4.3.x and classic queues, as 4.3 removes consumer-timeout for classic queues, from release notes:
"This release moves consumer timeout handling responsibility into the queues
themselves. Also, all protocols (except for the stream protocol) now evaluate
consumer timeout for queue types that support them. Classic queues and streams
never evaluate consumer timeouts as their use cases largely avoid the need for
such as feature."

I tested the following versions with CQs:
3.13.7:
2026-07-10 21:32:50.971873+00:00 [info] <0.216656.0> connection <0.216656.0> (CLIENTIP:58211 -> 10.56.72.190:5671): user 'lxdznype' authenticated and granted access to vhost 'lxdznype'
2026-07-10 21:34:50.993016+00:00 [warning] <0.216665.0> Consumer 'ctag1.b20bc54ee60848f897a5c69fb6682a38' on channel 1 and queue 'queue1' in vhost 'lxdznype' has timed out waiting for a consumer acknowledgement of a delivery with delivery tag = 1. Timeout used: 60000 ms. This timeout value can be configured, see consumers doc guide to learn more
2026-07-10 21:34:50.993785+00:00 [error] <0.216665.0> Channel error on connection <0.216656.0> (CLIENTIP:58211 -> 10.56.72.190:5671, vhost: 'lxdznype', user: 'lxdznype'), channel 1:
2026-07-10 21:34:50.993785+00:00 [error] <0.216665.0> operation none caused a channel exception precondition_failed: delivery acknowledgement on channel 1 timed out. Timeout value used: 60000 ms. This timeout value can be configured, see consumers doc guide to learn more


4.2.8:
2026-07-10 21:40:03.754753+00:00 [info] <0.2363.0> accepting AMQP connection CLIENTIP:58334 -> 10.56.72.190:5671
2026-07-10 21:40:03.778230+00:00 [info] <0.2363.0> connection CLIENTIP:58334 -> 10.56.72.190:5671 has a client-provided name: consumer-timeout-test
2026-07-10 21:40:03.798455+00:00 [info] <0.2363.0> connection CLIENTIP:58334 -> 10.56.72.190:5671 - consumer-timeout-test: user 'lxdznype' authenticated and granted access to vhost 'lxdznype'
2026-07-10 21:42:03.820355+00:00 [warning] <0.2372.0> Consumer 'ctag1.53e6b6359b05448c945f13410a92bc59' on channel 1 and queue 'queue1' in vhost 'lxdznype' has timed out waiting for a consumer acknowledgement of a delivery with delivery tag = 1. Timeout used: 60000 ms. This timeout value can be configured, see consumers doc guide to learn more
2026-07-10 21:42:03.820948+00:00 [error] <0.2372.0> Channel error on connection <0.2363.0> (CLIENTIP:58334 -> 10.56.72.190:5671, vhost: 'lxdznype', user: 'lxdznype'), channel 1:
2026-07-10 21:42:03.820948+00:00 [error] <0.2372.0> operation none caused a channel exception precondition_failed: delivery acknowledgement on channel 1 timed out. Timeout value used: 60000 ms. This timeout value can be configured, see consumers doc guide to learn more

/Johan
Reply all
Reply to author
Forward
0 new messages