[rabbitmq-discuss] Connection close forced

Adam Kaminiecki adamka at dgt.com.pl
Wed Nov 3 13:51:33 GMT 2010


Hi,

Im connecting to broker and before i going to send a message event occurs
ConnectionShutdown  with  reason "Connection close forced" code=200


my code:

var conFactory = new ConnectionFactory {Address = server};
                 using (conn = conFactory.CreateConnection())
                 {
                     conn.AutoClose = false;

                     using (var channel = conn.CreateModel())
                     {
                         channel.BasicReturn += new 
RabbitMQ.Client.Events.BasicReturnEventHandler(channel_BasicReturn);
                         if (channel.IsOpen)
                         {
                             channel.QueueDeclare(RmqQueue);
                         }

                     }
                 }
here event occurs

after that I'm using
byte[] messageBodyBytes = System.Text.Encoding.UTF8.GetBytes(message);
                 if (channel.IsOpen)
                 {
                     channel.BasicPublish(RmqQueue, RmqQueue, null, 
messageBodyBytes);
                 }

channel and connection is closed after QueueDeclare
what I'm doing wrong?


Regards,
Adam


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the rabbitmq-discuss mailing list