Hi Luke,
Thanks for your feedback.
UseCase 1:
When the messages are published and received using BasicGet.
we are getting the following error in our application log:
2022-11-08 14:42:12,239 [55] ERROR x.MessageQueue.Impls.RabbitmqRxReceiver [(null)] <(null)> - failed to receive message from queue
System.TimeoutException: The operation has timed out.
at RabbitMQ.Util.BlockingCell`1.WaitForValue(TimeSpan timeout)
at RabbitMQ.Client.Impl.SimpleBlockingRpcContinuation.GetReply(TimeSpan timeout)
at RabbitMQ.Client.Impl.ModelBase.BasicGet(String queue, Boolean autoAck)
at RabbitMQ.Client.Impl.AutorecoveringModel.BasicGet(String queue, Boolean autoAck)
After 30 minutes, we are getting the following error.
2022-11-08 15:12:15,261 [55] ERROR x.MessageQueue.Impls.RabbitmqRxReceiver [(null)] <(null)> - failed to receive message from queue
RabbitMQ.Client.Exceptions.AlreadyClosedException: Already closed: The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=406, text='PRECONDITION_FAILED - delivery acknowledgement on channel 1 timed out. Timeout value used: 1800000 ms. This timeout value can be configured, see consumers doc guide to learn more', classId=0, methodId=0
at RabbitMQ.Client.Impl.SessionBase.Transmit(OutgoingCommand& cmd)
at RabbitMQ.Client.Impl.ModelBase.ModelSend(MethodBase method, ContentHeaderBase header, ReadOnlyMemory`1 body)
at RabbitMQ.Client.Framing.Impl.Model._Private_BasicGet(String queue, Boolean autoAck)
at RabbitMQ.Client.Impl.ModelBase.BasicGet(String queue, Boolean autoAck)
at RabbitMQ.Client.Impl.AutorecoveringModel.BasicGet(String queue, Boolean autoAck)
Have attached RabbitMQ logs during the issue occurrence.(rab...@xxxxxx.log inside RabbitMQ_log folder)
UseCase 2:
We have tried to simulate this issue using sample application. In this sample we have published and received messages continuously using separate threads for both publish and receive.During Channel close exception we have recreated a new channel. During channel recreation at random times we also got exception and the thread which was used for receiving messages was aborted.
We did receive a connection shutdown error during observation and the following were the logs.
RabbitMQ logs (rabbit@aaaa - Shutdown& recreation connection.log):
2022-11-04 19:42:58.615000+05:30 [warning] <0.19876.0> client unexpectedly closed TCP connection
2022-11-04 19:42:58.616000+05:30 [error] <0.19880.0> supervisor: {<0.19880.0>,rabbit_channel_sup_sup}
2022-11-04 19:42:58.616000+05:30 [error] <0.19880.0> errorContext: shutdown_error
2022-11-04 19:42:58.616000+05:30 [error] <0.19880.0> reason: shutdown
Application log (rabbitSample.log):
2022-11-04 19:42:58,596 [16] ERROR Rabbitmq_Ack_App.RabbitReceiverTestQueue - failed to receive message from queue
RabbitMQ.Client.Exceptions.OperationInterruptedException: The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=406, text='PRECONDITION_FAILED - delivery acknowledgement on channel 1 timed out. Timeout value used: 300000 ms. This timeout value can be configured, see consumers doc guide to learn more', classId=0, methodId=0
at RabbitMQ.Client.Impl.SimpleBlockingRpcContinuation.GetReply(TimeSpan timeout)
at RabbitMQ.Client.Impl.ModelBase.BasicGet(String queue, Boolean autoAck)
at RabbitMQ.Client.Impl.AutorecoveringModel.BasicGet(String queue, Boolean autoAck)
at Rabbitmq_Ack_App.RabbitReceiverTestQueue.Receive() in D:\cccc\bbbbb\Rabbitmq_Ack_App\Rabbitmq_Ack_App\RabbitReceiverTestQueue.cs:line 37
2022-11-04 19:42:58,608 [14] ERROR Rabbitmq_Ack_App.Form1 - Receive Error : The AMQP operation was interrupted: AMQP close-reason, initiated by Library, code=541, text='Unexpected Exception', classId=0, methodId=0, cause=System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at RabbitMQ.Client.Impl.SessionManager.Lookup(Int32 number)
at RabbitMQ.Client.Framing.Impl.Connection.MainLoopIteration()
at RabbitMQ.Client.Framing.Impl.Connection.MainLoop() at RabbitMQ.Client.Impl.SimpleBlockingRpcContinuation.GetReply(TimeSpan timeout)
at RabbitMQ.Client.Impl.ModelBase.ModelRpc(MethodBase method, ContentHeaderBase header, Byte[] body)
at RabbitMQ.Client.Framing.Impl.Model._Private_ChannelOpen(String outOfBand)
at RabbitMQ.Client.Framing.Impl.AutorecoveringConnection.CreateNonRecoveringModel()
at RabbitMQ.Client.Framing.Impl.AutorecoveringConnection.CreateModel()
at Rabbitmq_Ack_App.RabbitReceiver.Receive() in D:\cccc\bbbbb\Rabbitmq_Ack_App\Rabbitmq_Ack_App\RabbitReceiver.cs:line 55
at Rabbitmq_Ack_App.Form1.ReceiveMessage() in D:\cccc\bbbbb\Rabbitmq_Ack_App\Rabbitmq_Ack_App\Form1.cs:line 90
Have attached the sample application and RabbitMQ logs. (Inside BasicGetSample_Case2 folder)
UseCase 3:
Have changed the code to BasicConsume in sample application and still getting error.
Have attached sample application code. (Inside BasicConsumeSample_Case3 folder)
It would be of great help if we can know the root cause for this issue. Please let us know if you need more information.