RabbitMQ .NET Client app timeout errors
search cancel

RabbitMQ .NET Client app timeout errors

book

Article ID: 297343

calendar_today

Updated On:

Products

Support Only for OpenSource RabbitMQ

Issue/Introduction

A .NET client application connecting to RabbitMQ throws the following timeout errors when publishing messages or declaring queues or exchanges.
"Message": "Unhandled exception was thrown.", "Exception": "System.TimeoutException: The operation has timed out.\r\n at RabbitMQ.Util.BlockingCell`1.WaitForValue(TimeSpan timeout)"

Evidence of the corresponding declare or publish operations cannot be seen in the RabbitMQ server logs - this rules out an issue with the server.

Environment

Product Version: 3.8

Resolution

Timeout errors can be seen as a result of a basic connectivity or network issue between the client app and the server. Therefore, the connection to the server or cluster itself should be confirmed as successful before troubleshooting further.

Timeouts can also be caused by the client application, and can be seen when a 'channel' object is not reused. For example, when a new channel is created for each new request to the client or for each publish operation.

Channels (as well as connections) are intended to be long lived and should be reused by the client per publish orĀ  declare operation.

For more information, see the following section from the RabbitMQ .NET client documentation on connection and channel lifespan: Connection and Channel Lifespan