首页 > 其他 > 详细

RabbitMQ连接上了如果要退出需要关闭两个连接

时间:2018-07-31 14:27:43      阅读:636      评论:0      收藏:0      [点我收藏+]

IConnection _connection = null;
 IModel _channel = null;
 EventingBasicConsumer _consumer = null;

if (null != _consumer && _consumer.IsRunning)
{
                    if (null != _channel) _channel.Close();
                    if (null != _connection) _connection.Close();
                    //这样就可以安全退出了
}

RabbitMQ连接上了如果要退出需要关闭两个连接

原文:https://www.cnblogs.com/liaojianwang/p/9395444.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!