public RabbitMqSafeChannel OpenSafeChannel()
 {
     Connect();
     var channel = new RabbitMqSafeChannel(this);
     channel.Reconnect();
     return channel;
 }
 public void Close()
 {
     if (safeChannel != null)
     {
         safeChannel.Close();
         safeChannel = null;
     }
     dequeuedMessages.Clear();
 }
        public void Open()
        {
            safeChannel = session.OpenSafeChannel();
            safeChannel.Channel.BasicQos(0, 1500, false);
            consumer = new QueueingBasicConsumer(safeChannel.Channel);

            safeChannel.Channel.BasicConsume(Name, false, consumer);
            dequeuedMessages = new Dictionary<EndpointMessage, BasicDeliverEventArgs>();
        }
        public void Declare()
        {
            if (safeChannel == null)
                safeChannel = session.OpenSafeChannel();

            safeChannel.Channel.QueueDeclare(Name, Durable, Exclusive, AutoDelete, RoutingHeaders);
            safeChannel.Close();
            safeChannel = null;
        }
 public void Close()
 {
     if (ReferenceEquals(null, safeChannel) == false)
     {
         lock (safeChannel)
         {
             if (ReferenceEquals(null, safeChannel) == false)
             {
                 safeChannel.Close();
                 safeChannel = null;
             }
         }
     }
 }
 public void Open()
 {
     if (ReferenceEquals(null, safeChannel))
         safeChannel = session.OpenSafeChannel();
 }