Connection Consumer disconnected from broker because of Unexpected Exception
See original GitHub issueDescribe the bug In some rare cases I got disconnection from rabbitmq, because of an exception in RabbitMQ.Client, on this line: https://github.com/rabbitmq/rabbitmq-dotnet-client/blob/v6.4.0/projects/RabbitMQ.Client/client/impl/ModelBase.cs#L702 (note that with 6.x.x releases there was no such exceptions)
Connection Consumer disconnected from broker xxxx:5672 because of Unexpected Exception -> System.InvalidOperationException: Unsolicited delivery - see IModel.DefaultConsumer to handle this case. at RabbitMQ.Client.Impl.ModelBase.HandleBasicDeliver(String consumerTag, UInt64 deliveryTag, Boolean redelivered, String exchange, String routingKey, IBasicProperties basicProperties, ReadOnlyMemory`1 body) at RabbitMQ.Client.Framing.Impl.Model.DispatchAsynchronous(IncomingCommand& cmd) at RabbitMQ.Client.Impl.ModelBase.HandleCommand(IncomingCommand& cmd) at RabbitMQ.Client.Impl.Session.HandleFrame(InboundFrame& frame) at RabbitMQ.Client.Framing.Impl.Connection.MainLoopIteration() at RabbitMQ.Client.Framing.Impl.Connection.MainLoop()
It looks like that there is no way to set IModel.DefaultConsumer to handle that exception (or at least I cannot find it).
To Reproduce It happens rarely having multiple rabbit mq consumers.
Expected behavior Handle the exception.
Please complete the following information):
- EasyNetQ version: [e.g.
7.0.4
] - RabbitMQ version [e.g.
3.8.16
]
Issue Analytics
- State:
- Created a year ago
- Comments:11 (7 by maintainers)
Top GitHub Comments
Thanks @Pliner, will check it, it was working as expected having RabbitMQ.Client 6.4.0 referenced in the project.
@zhelew https://www.nuget.org/packages/EasyNetQ/7.2.0-alpha1 It should install 6.4.0 RabbitMQ.Client.