RabbitMQ: .NET client drops the connections
search cancel

RabbitMQ: .NET client drops the connections

book

Article ID: 436566

calendar_today

Updated On:

Products

RabbitMQ VMware Tanzu RabbitMQ

Issue/Introduction

.Net client drops the connections and RabbitMQ side only has few heartbeat missing warnings and new Closing AMQP connection and Client unexpectedly closed TCP connection. 

RabbitMQ looks healthy. 

Environment

All RabbitMQ where the client is .Net runs on Windows.

Cause

The root cause — it was purely a Windows thread pool starvation problem on the client side.

The app runs a heavy I/O batch process that was saturating all available threads on the Windows host. When the RabbitMQ .NET client library needed to spin up a new thread to send a heartbeat to the broker, the thread pool had no free slots — so the heartbeat never went out.

Resolution

 Need get this fixed from application side, please try: 

// Example: Ensure at least 100-200 threads are available instantly
// to handle bursty I/O or heartbeats.
ThreadPool.SetMinThreads(200, 200);