Search code examples
gotcprabbitmqdisconnect

[Golang]Client rabbitMQ unexpectedly closed TCP connection, how to catch or fix it?


I'm using rabbitMQ Golang client for pub and sub message between two servers, but I often get bug: "client unexpectedly closed TCP connection". My rabbitMQ client is running normaly, but after distance of time it stop.

Who can help me how check catch this error and reconnect / fix this error.

Thanks so much


Solution

    1. Try with increased connection timeout
    2. Check your firewall configuration