SpringSource/spring-amqp — pull request #107 by garyrussell (2013-06-17 15:34:26+00:00)
Title: AMQP-323 Prevent Hang When No Close Response

https://jira.springsource.org/browse/AMQP-323

User reported a hang in CachingConnectionFactory.destroy()

The thread was hung indefinitely in the rabbit client waiting
for the close reply.

Add a 30 second timeout to the close, which will throw an exception
and allow the context to terminate.

Add an @ Ignore'd test that does not run on the CI build. The
test uses a proxy to drop the close response.

2013-06-17 16:31:42,350 DEBUG [main] RabbitUtils: Ignoring Connection exception - assuming already closed: clean connection shutdown; reason: java.util.concurrent.TimeoutException
com.rabbitmq.client.ShutdownSignalException: clean connection shutdown; reason: java.util.concurrent.TimeoutException
at com.rabbitmq.client.impl.AMQConnection.close(AMQConnection.java:807)
at com.rabbitmq.client.impl.AMQConnection.close(AMQConnection.java:724)
at com.rabbitmq.client.impl.AMQConnection.close(AMQConnection.java:710)
at org.springframework.amqp.rabbit.connection.SimpleConnection.close(SimpleConnection.java:52)
...