From fea6dd86867f9d39754d7e50132b59ae4428f106 Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Sat, 21 Jun 2025 00:05:11 +0200 Subject: [PATCH] Add queue_manager and stream_fanout This patch adds two new parameters to the toplevel class: - rabbit_use_queue_manager - rabbit_stream_fanout that are already handled by the oslo::messaging::rabbit class, which makes it impossible to set using watcher_config. Change-Id: I71ed8a8ea33ad8fb686f515b68a29b22a8660c44 --- manifests/init.pp | 12 ++++++++++++ ...e_manager-and-stream_fanout-cbb3bebc082d2922.yaml | 5 +++++ spec/classes/watcher_init_spec.rb | 6 ++++++ 3 files changed, 23 insertions(+) create mode 100644 releasenotes/notes/queue_manager-and-stream_fanout-cbb3bebc082d2922.yaml diff --git a/manifests/init.pp b/manifests/init.pp index 31a2542..8f9dd83 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -62,6 +62,14 @@ # (Optional) Limit the number of memory bytes used by the quorum queue. # Defaults to $facts['os_service_default'] # +# [*rabbit_use_queue_manager*] +# (Optional) Should we use consistant queue names or random ones. +# Defaults to $facts['os_service_default'] +# +# [*rabbit_stream_fanout*] +# (Optional) Use stream queues in RabbitMQ (x-queue-type: stream). +# Defaults to $facts['os_service_default'] +# # [*rabbit_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. @@ -196,6 +204,8 @@ class watcher ( $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'], + $rabbit_use_queue_manager = $facts['os_service_default'], + $rabbit_stream_fanout = $facts['os_service_default'], $rabbit_enable_cancel_on_failover = $facts['os_service_default'], $rabbit_transient_queues_ttl = $facts['os_service_default'], $rabbit_heartbeat_timeout_threshold = $facts['os_service_default'], @@ -258,6 +268,8 @@ class watcher ( 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, + use_queue_manager => $rabbit_use_queue_manager, + rabbit_stream_fanout => $rabbit_stream_fanout, enable_cancel_on_failover => $rabbit_enable_cancel_on_failover, rabbit_transient_queues_ttl => $rabbit_transient_queues_ttl, heartbeat_timeout_threshold => $rabbit_heartbeat_timeout_threshold, diff --git a/releasenotes/notes/queue_manager-and-stream_fanout-cbb3bebc082d2922.yaml b/releasenotes/notes/queue_manager-and-stream_fanout-cbb3bebc082d2922.yaml new file mode 100644 index 0000000..2e8729b --- /dev/null +++ b/releasenotes/notes/queue_manager-and-stream_fanout-cbb3bebc082d2922.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + The ``watcher`` class now has two new parameters + ``rabbit_use_queue_manager`` and ``rabbit_stream_fanout``. diff --git a/spec/classes/watcher_init_spec.rb b/spec/classes/watcher_init_spec.rb index 2e0ae53..68b7701 100644 --- a/spec/classes/watcher_init_spec.rb +++ b/spec/classes/watcher_init_spec.rb @@ -51,6 +51,8 @@ describe 'watcher' do :rabbit_quorum_delivery_limit => '', :rabbit_quorum_max_memory_length => '', :rabbit_quorum_max_memory_bytes => '', + :use_queue_manager => '', + :rabbit_stream_fanout => '', :enable_cancel_on_failover => '', :rabbit_retry_interval => '', ) @@ -82,6 +84,8 @@ describe 'watcher' do :rabbit_quorum_delivery_limit => 3, :rabbit_quorum_max_memory_length => 5, :rabbit_quorum_max_memory_bytes => 1073741824, + :rabbit_use_queue_manager => true, + :rabbit_stream_fanout => true, :rabbit_enable_cancel_on_failover => false, :rabbit_heartbeat_timeout_threshold => '60', :rabbit_heartbeat_rate => '10', @@ -121,6 +125,8 @@ describe 'watcher' do :rabbit_quorum_delivery_limit => 3, :rabbit_quorum_max_memory_length => 5, :rabbit_quorum_max_memory_bytes => 1073741824, + :use_queue_manager => true, + :rabbit_stream_fanout => true, :enable_cancel_on_failover => false, :rabbit_retry_interval => '', )