Skip to content

AlexSischin/spring-amqp-timeout-error

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is this?

A simple reproducible example of the problem with Spring Rabbit when DirectMessageListenerContainer permanently discards a listener when TimeoutException occurs in consume method. See GitHub issue for details.

Tested on versions: 4.1.0-M2, 3.2.9, 3.2.8.

Steps to reproduce

Start RabbitMQ container:

docker compose up -d

Start application:

./mvnw spring-boot:run

Wait for application to initialize and start a consumer, then pause the RabbitMQ container:

docker pause spring-amqp-timeout-error-rabbitmq-1

Wait for the DirectMessageListenerContainer to fail the scheduled job and stop reconnection attempts with the following exception:

2026-03-04 00:40:16.348 ERROR [org.springframework.amqp.rabbit.RabbitListenerEndpointContainer#0-consumerMonitor-1] o.s.s.s.TaskUtils$LoggingErrorHandler - Unexpected error occurred in scheduled task
org.springframework.amqp.AmqpTimeoutException: java.util.concurrent.TimeoutException
        at org.springframework.amqp.rabbit.support.RabbitExceptionTranslator.convertRabbitAccessException(RabbitExceptionTranslator.java:72)
        at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:629)
        at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createConnection(CachingConnectionFactory.java:745)
        at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createBareChannel(CachingConnectionFactory.java:682)
        at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.getCachedChannelProxy(CachingConnectionFactory.java:655)
        at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.getChannel(CachingConnectionFactory.java:544)
        at org.springframework.amqp.rabbit.connection.CachingConnectionFactory$ChannelCachingConnectionProxy.createChannel(CachingConnectionFactory.java:1509)
        at org.springframework.amqp.rabbit.listener.DirectMessageListenerContainer.consume(DirectMessageListenerContainer.java:813)
        at org.springframework.amqp.rabbit.listener.DirectMessageListenerContainer.doConsumeFromQueue(DirectMessageListenerContainer.java:780)
        at org.springframework.amqp.rabbit.listener.DirectMessageListenerContainer.restartConsumer(DirectMessageListenerContainer.java:610)
        at org.springframework.amqp.rabbit.listener.DirectMessageListenerContainer.lambda$startMonitor$0(DirectMessageListenerContainer.java:533)
        at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:545)
        at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:369)
        at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:310)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
        at java.base/java.lang.Thread.run(Thread.java:1474)
Caused by: java.util.concurrent.TimeoutException
        at com.rabbitmq.utility.BlockingCell.get(BlockingCell.java:68)
        at com.rabbitmq.utility.BlockingCell.uninterruptibleGet(BlockingCell.java:112)
        at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:36)
        at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:552)
        at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:341)
        at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1357)
        at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1297)
        at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1680)
        at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.connectHostPort(AbstractConnectionFactory.java:693)
        at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.connect(AbstractConnectionFactory.java:647)
        at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:590)
        ... 16 common frames omitted

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages