Add kombu_failover_strategy option

Adds the kombu_failover_strategy option for configuring
oslo.messaging.rabbit. This will determines how the next RabbitMQ node
is chosen in case the one we are currently connected to becomes
unavailable.

Change-Id: Ia0512a8f9b3248127b9c2ee96821e4d793ae6523
Closes-Bug: #1748353
(cherry picked from commit f0068d143b)
This commit is contained in:
ZhongShengping 2018-02-09 14:56:06 +08:00 committed by zhongshengping
parent 8e675cacc3
commit 859efcfad7
3 changed files with 17 additions and 0 deletions

View File

@ -70,6 +70,12 @@
# consumer cancel notification.
# Defaults to '$::os_service_default
#
# [*kombu_failover_strategy*]
# (Optional) Determines how the next RabbitMQ node is chosen in case the one
# we are currently connected to becomes unavailable. Takes effect only if
# more than one RabbitMQ node is provided in config. (string value)
# Defaults to $::os_service_default
#
# [*kombu_compression*]
# (optional) Possible values are: gzip, bz2. If not set compression will not
# be used. This option may notbe available in future versions. EXPERIMENTAL.
@ -195,6 +201,7 @@ class octavia (
$kombu_ssl_keyfile = $::os_service_default,
$kombu_ssl_version = $::os_service_default,
$kombu_reconnect_delay = $::os_service_default,
$kombu_failover_strategy = $::os_service_default,
$kombu_compression = $::os_service_default,
$amqp_durable_queues = $::os_service_default,
$amqp_server_request_prefix = $::os_service_default,
@ -254,6 +261,7 @@ the future release. Please use octavia::package_ensure instead.")
heartbeat_rate => $rabbit_heartbeat_rate,
rabbit_use_ssl => $rabbit_use_ssl,
kombu_reconnect_delay => $kombu_reconnect_delay,
kombu_failover_strategy => $kombu_failover_strategy,
kombu_ssl_version => $kombu_ssl_version,
kombu_ssl_keyfile => $kombu_ssl_keyfile,
kombu_ssl_certfile => $kombu_ssl_certfile,

View File

@ -0,0 +1,6 @@
---
features:
- |
Adds the kombu_failover_strategy option for configuring oslo.messaging.rabbit.
This will determines how the next RabbitMQ node is chosen in case the one we
are currently connected to becomes unavailable.

View File

@ -38,6 +38,7 @@ describe 'octavia' do
is_expected.to contain_octavia_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('oslo_messaging_rabbit/heartbeat_rate').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('oslo_messaging_rabbit/kombu_compression').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('oslo_messaging_rabbit/kombu_failover_strategy').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('oslo_messaging_notifications/transport_url').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('oslo_messaging_notifications/driver').with_value('<SERVICE DEFAULT>')
end
@ -57,6 +58,7 @@ describe 'octavia' do
:rabbit_heartbeat_timeout_threshold => '60',
:rabbit_heartbeat_rate => '10',
:kombu_compression => 'gzip',
:kombu_failover_strategy => 'shuffle',
:package_ensure => '2012.1.1-15.el6',
:notification_transport_url => 'rabbit://rabbit_user:password@localhost:5673',
:notification_driver => 'ceilometer.compute.octavia_notifier',
@ -72,6 +74,7 @@ describe 'octavia' do
is_expected.to contain_octavia_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('60')
is_expected.to contain_octavia_config('oslo_messaging_rabbit/heartbeat_rate').with_value('10')
is_expected.to contain_octavia_config('oslo_messaging_rabbit/kombu_compression').with_value('gzip')
is_expected.to contain_octavia_config('oslo_messaging_rabbit/kombu_failover_strategy').with_value('shuffle')
end
it 'configures various things' do