From 25ada7c7bfb8d75ed744af662d0a7a0ec340a836 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Fri, 6 Sep 2024 23:08:38 +0900 Subject: [PATCH] Add support for [oslo_messaging_rabbit] enable_cancel_on_failover Change-Id: I4bb86dddde72abf58359956ffd0ba9cca8281a3d --- manifests/messaging/rabbit.pp | 7 +++++++ ...abbitmq-enable_cancel_on_failover-267c874b7d4df486.yaml | 5 +++++ spec/defines/oslo_messaging_rabbit_spec.rb | 3 +++ 3 files changed, 15 insertions(+) create mode 100644 releasenotes/notes/rabbitmq-enable_cancel_on_failover-267c874b7d4df486.yaml diff --git a/manifests/messaging/rabbit.pp b/manifests/messaging/rabbit.pp index 605a64d..ba26649 100644 --- a/manifests/messaging/rabbit.pp +++ b/manifests/messaging/rabbit.pp @@ -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 }, diff --git a/releasenotes/notes/rabbitmq-enable_cancel_on_failover-267c874b7d4df486.yaml b/releasenotes/notes/rabbitmq-enable_cancel_on_failover-267c874b7d4df486.yaml new file mode 100644 index 0000000..7602a5d --- /dev/null +++ b/releasenotes/notes/rabbitmq-enable_cancel_on_failover-267c874b7d4df486.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + The new ``oslo::messaging::rabbitmq::enable_cancel_on_failover`` parameter + has been added. diff --git a/spec/defines/oslo_messaging_rabbit_spec.rb b/spec/defines/oslo_messaging_rabbit_spec.rb index 5245287..b96c44f 100644 --- a/spec/defines/oslo_messaging_rabbit_spec.rb +++ b/spec/defines/oslo_messaging_rabbit_spec.rb @@ -29,6 +29,7 @@ describe 'oslo::messaging::rabbit' do is_expected.to contain_keystone_config('oslo_messaging_rabbit/rabbit_quorum_delivery_limit').with_value('') is_expected.to contain_keystone_config('oslo_messaging_rabbit/rabbit_quorum_max_memory_length').with_value('') is_expected.to contain_keystone_config('oslo_messaging_rabbit/rabbit_quorum_max_memory_bytes').with_value('') + is_expected.to contain_keystone_config('oslo_messaging_rabbit/enable_cancel_on_failover').with_value('') 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