spring-projects/spring-amqp — pull request #212 by artembilan (2014-09-11 15:11:34+00:00)
Title: AMQP-388 Issue basicCancel from container on stop

JIRA: https://jira.spring.io/browse/AMQP-388

Previously the `SimpleMessageListenerContainer` postponed the real `BlockingQueueConsumer.stop`
with some artificial `quiesce` timeout to block receive thread with `CountDownLatch` until `BlockingQueueConsumer.stop()` will be invoked.

Change `quiesce` timeout to the real `basicCancel` from all `Consumer.stop` cases.
Postpone `SimpleMessageListenerContainer.this.cancellationLock.release(this.consumer);` in the `AsyncMessageProcessingConsumer` until there are messages
to deliver in the internal queue of the `BlockingQueueConsumer`.