From 193d0e6cd26c5ab23a9d089cb8594b6bcb394325 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Thu, 14 Sep 2023 10:41:32 +0900 Subject: [PATCH] RabbitMQ: Add support for quorum queue options Depends-on: https://review.opendev.org/894866 Change-Id: I644af1c7d7f4721b200fc0b771ad84609e2eb4b6 --- manifests/init.pp | 52 +++++++++++---- .../rabbit-quorum-queue-ce16be662b5e35c6.yaml | 4 ++ spec/classes/aodh_init_spec.rb | 64 +++++++++++-------- 3 files changed, 81 insertions(+), 39 deletions(-) create mode 100644 releasenotes/notes/rabbit-quorum-queue-ce16be662b5e35c6.yaml diff --git a/manifests/init.pp b/manifests/init.pp index 6b6ff1c0..8ca6b534 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -66,6 +66,24 @@ # will be run through a green thread. # Defaults to $facts['os_service_default'] # +# [*rabbit_quorum_queue*] +# (Optional) Use quorum queues in RabbitMQ. +# Defaults to $facts['os_service_default'] +# +# [*rabbit_quorum_delivery_limit*] +# (Optional) Each time a message is rdelivered to a consumer, a counter is +# incremented. Once the redelivery count exceeds the delivery limit +# the message gets dropped or dead-lettered. +# Defaults to $facts['os_service_default'] +# +# [*rabbit_quorum_max_memory_length*] +# (Optional) Limit the number of messages in the quorum queue. +# Defaults to $facts['os_service_default'] +# +# [*rabbit_quorum_max_memory_bytes*] +# (Optional) Limit the number of memory bytes used by the quorum queue. +# Defaults to $facts['os_service_default'] +# # [*kombu_ssl_ca_certs*] # (optional) SSL certification authority file (valid only if SSL enabled). # Defaults to $facts['os_service_default'] @@ -197,6 +215,10 @@ class aodh ( $rabbit_heartbeat_rate = $facts['os_service_default'], $rabbit_heartbeat_in_pthread = $facts['os_service_default'], $rabbit_ha_queues = $facts['os_service_default'], + $rabbit_quorum_queue = $facts['os_service_default'], + $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'], $kombu_ssl_ca_certs = $facts['os_service_default'], $kombu_ssl_certfile = $facts['os_service_default'], $kombu_ssl_keyfile = $facts['os_service_default'], @@ -240,19 +262,23 @@ class aodh ( } oslo::messaging::rabbit { 'aodh_config': - rabbit_ha_queues => $rabbit_ha_queues, - heartbeat_timeout_threshold => $rabbit_heartbeat_timeout_threshold, - heartbeat_rate => $rabbit_heartbeat_rate, - heartbeat_in_pthread => $rabbit_heartbeat_in_pthread, - 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, - kombu_ssl_ca_certs => $kombu_ssl_ca_certs, - kombu_compression => $kombu_compression, - amqp_durable_queues => $amqp_durable_queues, + rabbit_ha_queues => $rabbit_ha_queues, + heartbeat_timeout_threshold => $rabbit_heartbeat_timeout_threshold, + heartbeat_rate => $rabbit_heartbeat_rate, + heartbeat_in_pthread => $rabbit_heartbeat_in_pthread, + 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, + kombu_ssl_ca_certs => $kombu_ssl_ca_certs, + kombu_compression => $kombu_compression, + amqp_durable_queues => $amqp_durable_queues, + rabbit_quorum_queue => $rabbit_quorum_queue, + rabbit_quorum_delivery_limit => $rabbit_quorum_delivery_limit, + rabbit_quorum_max_memory_length => $rabbit_quorum_max_memory_length, + rabbit_quorum_max_memory_bytes => $rabbit_quorum_max_memory_bytes, } oslo::messaging::amqp { 'aodh_config': diff --git a/releasenotes/notes/rabbit-quorum-queue-ce16be662b5e35c6.yaml b/releasenotes/notes/rabbit-quorum-queue-ce16be662b5e35c6.yaml new file mode 100644 index 00000000..cb1a6a69 --- /dev/null +++ b/releasenotes/notes/rabbit-quorum-queue-ce16be662b5e35c6.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + The ``aodh`` class now supports options for quorum queues in RabbitMQ. diff --git a/spec/classes/aodh_init_spec.rb b/spec/classes/aodh_init_spec.rb index 0e04f0f1..a4801bdf 100644 --- a/spec/classes/aodh_init_spec.rb +++ b/spec/classes/aodh_init_spec.rb @@ -28,20 +28,24 @@ describe 'aodh' do :control_exchange => '' ) is_expected.to contain_oslo__messaging__rabbit('aodh_config').with( - :rabbit_use_ssl => '', - :heartbeat_timeout_threshold => '', - :heartbeat_rate => '', - :heartbeat_in_pthread => '', - :kombu_reconnect_delay => '', - :kombu_failover_strategy => '', - :amqp_durable_queues => '', - :kombu_compression => '', - :kombu_ssl_ca_certs => '', - :kombu_ssl_certfile => '', - :kombu_ssl_keyfile => '', - :kombu_ssl_version => '', - :rabbit_ha_queues => '', - :rabbit_retry_interval => '', + :rabbit_use_ssl => '', + :heartbeat_timeout_threshold => '', + :heartbeat_rate => '', + :heartbeat_in_pthread => '', + :kombu_reconnect_delay => '', + :kombu_failover_strategy => '', + :amqp_durable_queues => '', + :kombu_compression => '', + :kombu_ssl_ca_certs => '', + :kombu_ssl_certfile => '', + :kombu_ssl_keyfile => '', + :kombu_ssl_version => '', + :rabbit_ha_queues => '', + :rabbit_retry_interval => '', + :rabbit_quorum_queue => '', + :rabbit_quorum_delivery_limit => '', + :rabbit_quorum_max_memory_length => '', + :rabbit_quorum_max_memory_bytes => '', ) is_expected.to contain_oslo__messaging__amqp('aodh_config').with( :server_request_prefix => '', @@ -96,6 +100,10 @@ describe 'aodh' do :kombu_ssl_keyfile => '/etc/key', :kombu_ssl_version => 'TLSv1', :rabbit_ha_queues => true, + :rabbit_quorum_queue => true, + :rabbit_quorum_delivery_limit => 3, + :rabbit_quorum_max_memory_length => 5, + :rabbit_quorum_max_memory_bytes => 1073741824, :amqp_idle_timeout => '60', :amqp_trace => true, :amqp_ssl_ca_file => '/etc/ca.cert', @@ -119,18 +127,22 @@ describe 'aodh' do :control_exchange => 'aodh', ) is_expected.to contain_oslo__messaging__rabbit('aodh_config').with( - :rabbit_use_ssl => true, - :heartbeat_timeout_threshold => '60', - :heartbeat_rate => '10', - :heartbeat_in_pthread => true, - :kombu_reconnect_delay => '5.0', - :amqp_durable_queues => true, - :kombu_compression => 'gzip', - :kombu_ssl_ca_certs => '/etc/ca.cert', - :kombu_ssl_certfile => '/etc/certfile', - :kombu_ssl_keyfile => '/etc/key', - :kombu_ssl_version => 'TLSv1', - :rabbit_ha_queues => true, + :rabbit_use_ssl => true, + :heartbeat_timeout_threshold => '60', + :heartbeat_rate => '10', + :heartbeat_in_pthread => true, + :kombu_reconnect_delay => '5.0', + :amqp_durable_queues => true, + :kombu_compression => 'gzip', + :kombu_ssl_ca_certs => '/etc/ca.cert', + :kombu_ssl_certfile => '/etc/certfile', + :kombu_ssl_keyfile => '/etc/key', + :kombu_ssl_version => 'TLSv1', + :rabbit_ha_queues => true, + :rabbit_quorum_queue => true, + :rabbit_quorum_delivery_limit => 3, + :rabbit_quorum_max_memory_length => 5, + :rabbit_quorum_max_memory_bytes => 1073741824, ) is_expected.to contain_oslo__messaging__amqp('aodh_config').with( :idle_timeout => '60',