Browse code

rpc: Allow to configure the rabbitmq heartbeat

For testing we can need to disable or change the rate of the heartbeat
Currently we have to set the value manually in each componments or
to write multiple [[post-config|$<APP>_CONF]] section in local.conf.

This change will allow to configure all componments at once with only two
lines.

Also, we don't set default values to continue to use oslo.messaging
defaults.

Change-Id: Ieaca60ca1cd6d7455b66ce490a9b023df431e9c3

Mehdi Abaakouk authored on 2015/04/09 18:46:56
Showing 1 changed files
... ...
@@ -273,6 +273,12 @@ function iniset_rpc_backend {
273 273
         iniset $file oslo_messaging_rabbit rabbit_hosts $RABBIT_HOST
274 274
         iniset $file oslo_messaging_rabbit rabbit_password $RABBIT_PASSWORD
275 275
         iniset $file oslo_messaging_rabbit rabbit_userid $RABBIT_USERID
276
+        if [ -n "$RABBIT_HEARTBEAT_TIMEOUT_THRESHOLD" ]; then
277
+            iniset $file oslo_messaging_rabbit heartbeat_timeout_threshold $RABBIT_HEARTBEAT_TIMEOUT_THRESHOLD
278
+        fi
279
+        if [ -n "$RABBIT_HEARTBEAT_RATE" ]; then
280
+            iniset $file oslo_messaging_rabbit heartbeat_rate $RABBIT_HEARTBEAT_RATE
281
+        fi
276 282
     fi
277 283
 }
278 284