[rabbitmq-discuss] AMQP connection close in WCF

Паховский Дмитрий d.pakhovskiy at eastwind.ru
Thu Apr 12 11:11:29 BST 2012


Hello!

I use Rabbit with WCF. When I create a proxy, AMQP connection is established. But when I dispose(or close or abort - behavior is the same) the proxy,
AMQP connection isn`t broken.

Here is an example:

using (var proxy = new TestRabbitServiceClient())
{
   proxy.DoSmth();
}
// the connection is still alive!

I dug into RabbitMQ.ServiceModel and discovered that connection is set to AutoClose (RabbitMQTransportBindingElement.InternalOpen()).
The RabbitMQTransportBindingElement.Close() method closes the channel so the connection should be closed too (because of AutoClose).
I put the breakpoint on RabbitMQTransportBindingElement.Close(), where the channel should be closed, and started debug.
But the method didn`t invoke when TestRabbitServiceClient.Dispose() was invoked!
Could you explain this behavior of RabbitMQ.ServiceModel? How can I force closing the connection?

Thanks!
Dmitry.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120412/175676fe/attachment.htm>


More information about the rabbitmq-discuss mailing list