[rabbitmq-discuss] .NET client. Bug in subscription Dispose?

Alexey gmlexx at gmail.com
Wed Apr 18 12:09:33 BST 2012


We'd created a rabbitmq client class wich has the following variables:

IModel Channel;
Subscription Subscription;

Channel and Subscription created as usual:

Channel = activeConnection.CreateModel();
Subscription = new Subscription(Channel, queueName, false);

This is our disconnect method:

public void Disconnect(){
	using(Channel)
	using(Subscription)
	{
		Subscription = null;
		Channel = null;
	}
	activeConnection = null;
}

usually it works fine, but rarely failed with the following exception

System.NullReferenceException:
   в RabbitMQ.Client.Impl.ModelBase.BasicCancel(String consumerTag)
   в RabbitMQ.Client.MessagePatterns.Subscription.Close()
   в
RabbitMQ.Client.MessagePatterns.Subscription.System.IDisposable.Dispose()
   в Diadoc.Protocols.RabbitMQ.RabbitClusterClient.Disconnect()



More information about the rabbitmq-discuss mailing list