将 EasyNetQ 3.4.5 升级到最新的 6.3.1 后出现“意外异常”

问题描述

将 EasyNetQ 包升级到 6.3.1 后,出现以下错误代码在 3.4.5 版本上运行

The AMQP operation was interrupted: AMQP close-reason,initiated by Library,code=541,text='Unexpected Exception',classId=0,methodId=0,cause=System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.sockets.socketException: An existing connection was forcibly closed by the remote host
   at System.Net.sockets.socket.Receive(Byte[] buffer,Int32 offset,Int32 size,SocketFlags socketFlags)
   at System.Net.sockets.NetworkStream.Read(Byte[] buffer,Int32 size)
   --- End of inner exception stack trace ---
   at System.Net.sockets.NetworkStream.Read(Byte[] buffer,Int32 size)
   at System.IO.BufferedStream.ReadByte()
   at RabbitMQ.Client.Impl.InboundFrame.ReadFrom(Stream reader,Byte[] frameHeaderBuffer) in /_/projects/RabbitMQ.Client/client/impl/Frame.cs:line 222
   at RabbitMQ.Client.Impl.socketFrameHandler.ReadFrame() in /_/projects/RabbitMQ.Client/client/impl/SocketFrameHandler.cs:line 220
   at RabbitMQ.Client.Framing.Impl.Connection.MainLoopIteration() in /_/projects/RabbitMQ.Client/client/impl/Connection.cs:line 557
   at RabbitMQ.Client.Framing.Impl.Connection.MainLoop() in /_/projects/RabbitMQ.Client/client/impl/Connection.cs:line 499

下面第 autoSubscriber.Subscribe(new []{ assembly }); 行的代码错误

var autoSubscriber = new AutoSubscriber(_bus,"Workers")
            {
                AutoSubscriberMessagedispatcher = _dispatcher
            };
            var assembly = GetType().Assembly;

            autoSubscriber.Subscribe(new []{ assembly });

我检查了 RabbitMQ 管理门户,没有任何连接。 我的连接字符串是 host=localhost;virtualHost=DEV

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)