This repository was archived by the owner on Dec 31, 2025. It is now read-only.

Description
We are experiencing disconnection issues when using NATS behind a load balancer. The client gets disconnected with the following error message:
10:42:38 Disconnected due to: read tcp 10.8.0.19:52465->51.21.46.456:4222: read: operation timed out, will attempt reconnect
10:42:41 Reconnected [nats://nats.uat.com:4222]
The connection is restored shortly after, but the disconnection disrupts application workflows. This issue occurs intermittently and seems related to the network configuration with the load balancer.
Deploy NATS server behind a load balancer.
Use a client to connect and observe intermittent disconnections.
Expected Behavior:
The client should maintain a stable connection to the NATS server without frequent disconnections.
Actual Behavior:
The client disconnects with a timeout error and reconnects after a short interval.
Logs:
Timestamp: 10:42:38
Error: Disconnected due to: read tcp 10.8.0.19:52465->51.21.46.456:4222: read: operation timed out
Possible Causes:
Can anyone help me to resolve this issue