jhalterman / lyra

High availability RabbitMQ client
Apache License 2.0
262 stars 74 forks source link

Getting Rabbitmq HeartBeat Exception #89

Closed Akhilesh-Soni closed 6 years ago

Akhilesh-Soni commented 6 years ago

I am facing one issue with rabbitmq, that it terminate the connection with below exception

 {"message":"com.rabbitmq.client.AlreadyClosedException: connection is already closed due to connection error; cause: com.rabbitmq.client.MissedHeartbeatException: Heartbeat missing with heartbeat = 60 seconds"}

so I am using following configuration for it:-

  1. Rabbitmq docker on aws with t2_small server.

  2. Set following configuration for rabbitmq

factory.setAutomaticRecoveryEnabled(true); factory.setNetworkRecoveryInterval(1000); factory.setRequestedHeartbeat(60);

I just not able to understand what can be the reason for getting this type of error, how can we resolve this issue.

acogoluegnes commented 6 years ago

You should not use Lyra and RabbitMQ Java client automatic connection recovery together (there's a warning in the readme). Note also Lyra is no longer under active development. If your problem persist, please create a thread on RabbitMQ mailing list.

nursba commented 5 years ago

I have the same issue, please tell what's Lyra ?

Akhilesh-Soni commented 5 years ago

Hi @nursba,

I have solved that issue by increasing the configuration of aws server from t2_small to t2_medium. The problem we found that as we increased the load on rabbitmq, it needed more RAM to process those messages and since the current configuration was not sufficient to handle the load, we were getting those exceptions.

After increasing the server configuration, we were not getting that exception. By the way, Lyra is a rabbitmq client(kind of wrapper based on original rabbitmq client) written in Java.

Here' the link https://github.com/jhalterman/lyra