spring-projects/spring-amqp — pull request #154 by garyrussell (2014-01-24 22:56:53+00:00)
Title: AMQP-365 Fix Test Race Condition; Polish Shutdown

JIRA: https://jira.springsource.org/browse/AMQP-365

See the JIRA issue for a description of the race condition.

Also, these tests destroy the connection factory while the
container is still running (it is stopped in the After method
which is after the factory was destroyed).

This identified a further problem with container shutdown in
that the concwsumertainer never receives a cancel() and hence the
container thinks a force close is needed.

* Fix the race condition as described in the JIRA
* Count down the `activeObjectCounter` when a shutdown signal is received
* More polish on the shutdown logging; don't log a stack trace (even under DEBUG) for
a "normal" close - extract the common logic to `RabbitUtils`

__Needs a backport PR for 1.2.x - with just the test case fix__