03fd31a6b206294593e2f8eef1a269b30e84102b
configuration/environments_scripts/rabbitmq_instance_setup/setup-rabbitmq-server.sh
| ... | ... | @@ -33,10 +33,10 @@ else |
| 33 | 33 | # Wait for RabbitMQ to become available; note that install under apt also means start... |
| 34 | 34 | sleep 10 |
| 35 | 35 | sudo rabbitmq-plugins enable rabbitmq_management |
| 36 | - # Allow guest login from non-localhost IPs: |
|
| 36 | + # Allow guest login from non-localhost IPs and specify the heartbeat timeout to 24h / 1d: |
|
| 37 | 37 | sudo su - -c "cat <<EOF >>/etc/rabbitmq/rabbitmq.conf |
| 38 | 38 | loopback_users = none |
| 39 | -heartbeat = 0 |
|
| 39 | +heartbeat = 86400 |
|
| 40 | 40 | EOF |
| 41 | 41 | " |
| 42 | 42 | sudo systemctl restart rabbitmq-server.service |
java/com.sap.sse.replication/src/com/sap/sse/replication/RabbitMQConnectionFactoryHelper.java
| ... | ... | @@ -13,7 +13,7 @@ public class RabbitMQConnectionFactoryHelper { |
| 13 | 13 | connectionFactory.setAutomaticRecoveryEnabled(true); |
| 14 | 14 | connectionFactory.setTopologyRecoveryEnabled(true); |
| 15 | 15 | connectionFactory.setNetworkRecoveryInterval(10000); |
| 16 | - connectionFactory.setRequestedHeartbeat(0); |
|
| 16 | + connectionFactory.setRequestedHeartbeat(24*3600); // no heartbeat in 24h allows for dropping connection |
|
| 17 | 17 | return connectionFactory; |
| 18 | 18 | } |
| 19 | 19 | } |