Add support for [oslo_messaging_rabbit] enable_cancel_on_failover

Change-Id: I4bb86dddde72abf58359956ffd0ba9cca8281a3d
This commit is contained in:
Takashi Kajinami 2024-09-06 23:08:38 +09:00
parent cf57c9e3df
commit 25ada7c7bf
3 changed files with 15 additions and 0 deletions

View File

@ -135,6 +135,11 @@
# (Optional) Limit the number of memory bytes used by the quorum queue.
# Defaults to $facts['os_service_default']
#
# [*enable_cancel_on_failover*]
# (Optional) Enable x-cancel-on-ha-failover flag so that rabbitmq server will
# cancel and notify consumers when queue is down.
# Defaults to $facts['os_service_default']
#
define oslo::messaging::rabbit(
$amqp_durable_queues = $facts['os_service_default'],
$kombu_ssl_version = $facts['os_service_default'],
@ -161,6 +166,7 @@ define oslo::messaging::rabbit(
$rabbit_quorum_delivery_limit = $facts['os_service_default'],
$rabbit_quorum_max_memory_length = $facts['os_service_default'],
$rabbit_quorum_max_memory_bytes = $facts['os_service_default'],
$enable_cancel_on_failover = $facts['os_service_default'],
){
$kombu_ssl_ca_certs_set = (!is_service_default($kombu_ssl_ca_certs) and ($kombu_ssl_ca_certs))
@ -213,6 +219,7 @@ define oslo::messaging::rabbit(
'oslo_messaging_rabbit/rabbit_quorum_delivery_limit' => { value => $rabbit_quorum_delivery_limit },
'oslo_messaging_rabbit/rabbit_quorum_max_memory_length' => { value => $rabbit_quorum_max_memory_length },
'oslo_messaging_rabbit/rabbit_quorum_max_memory_bytes' => { value => $rabbit_quorum_max_memory_bytes },
'oslo_messaging_rabbit/enable_cancel_on_failover' => { value => $enable_cancel_on_failover },
'oslo_messaging_rabbit/ssl_ca_file' => { value => $kombu_ssl_ca_certs },
'oslo_messaging_rabbit/ssl_cert_file' => { value => $kombu_ssl_certfile },
'oslo_messaging_rabbit/ssl_key_file' => { value => $kombu_ssl_keyfile },

View File

@ -0,0 +1,5 @@
---
features:
- |
The new ``oslo::messaging::rabbitmq::enable_cancel_on_failover`` parameter
has been added.

View File

@ -29,6 +29,7 @@ describe 'oslo::messaging::rabbit' do
is_expected.to contain_keystone_config('oslo_messaging_rabbit/rabbit_quorum_delivery_limit').with_value('<SERVICE DEFAULT>')
is_expected.to contain_keystone_config('oslo_messaging_rabbit/rabbit_quorum_max_memory_length').with_value('<SERVICE DEFAULT>')
is_expected.to contain_keystone_config('oslo_messaging_rabbit/rabbit_quorum_max_memory_bytes').with_value('<SERVICE DEFAULT>')
is_expected.to contain_keystone_config('oslo_messaging_rabbit/enable_cancel_on_failover').with_value('<SERVICE DEFAULT>')
end
end
@ -46,6 +47,7 @@ describe 'oslo::messaging::rabbit' do
:rabbit_quorum_delivery_limit => 3,
:rabbit_quorum_max_memory_length => 5,
:rabbit_quorum_max_memory_bytes => 1073741824,
:enable_cancel_on_failover => false,
}
end
@ -61,6 +63,7 @@ describe 'oslo::messaging::rabbit' do
is_expected.to contain_keystone_config('oslo_messaging_rabbit/rabbit_quorum_delivery_limit').with_value(3)
is_expected.to contain_keystone_config('oslo_messaging_rabbit/rabbit_quorum_max_memory_length').with_value(5)
is_expected.to contain_keystone_config('oslo_messaging_rabbit/rabbit_quorum_max_memory_bytes').with_value(1073741824)
is_expected.to contain_keystone_config('oslo_messaging_rabbit/enable_cancel_on_failover').with_value(false)
end
end