In what version(s) of Spring AMQP are you seeing this issue?
For example:
3.0.6
Describe the bug
When a CachingConnectionFactory is used in a SimpleMessageContainer and then there is a connection reset (network glitch, Rabbit restart etc.,), SimpleMessageContainer tries to restart the consumer. However the checkout permits assigned to the lost channels in CachingConnectionFactory is not reclaimed. So the consumer is unable to create channels and recover.
To Reproduce
Execute attached test to reproduce the issue. The test setup attempts to send and receive 10 messages. There is a sleep timeout on L#63 to allow for time to restart RabbitMQ. Once the test has started it will send 1 message successfully and prompt to restart RabbitMQ. After the restart it can be observed that the consumers are no longer receiving messages.
Expected behavior
Consumer should be able to recover from connection failures
Sample
RabbitReconnectProblemTest.txt