mikehadlow/EasyNetQ — pull request #119 by danielwhite (2013-11-06 09:18:13+00:00)
Title: Fix channel leakage when broker sends consumer cancel notifications

The simplest way that this can occur is when deleting the queue (i.e. IAdvancedBus.QueueDelete).

What ends up happening is that the transient queue is removed from the ConsumerFactory, the underlying resources are never cleaned up and so the channels end up building up until the connection is lost.

Two potential issues:

* PersistentConsumer currently isn't included in this since it seems as though it should handle cancellation differently.
* The disposal of the model is a little funky. I'm not sure if the underlying cause is the same bug I've seen reported before: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2012-October/023410.html. By disposing via the queue the model seems to get disposed successfully when connected to RabbitMQ.