Add a rabbit_transient_queues_ttl and amqp_auto_delete params

The amqp_auto_delete option needs this patch:
https://review.opendev.org/c/openstack/puppet-oslo/+/944132

Since transient_queues_ttl is also managed by oslo::messaging::rabbit,
there's no way to use barbican_config to set it, so this patch is
mandatory for one to set rabbit_transient_queues_ttl in barbican.conf.

Change-Id: Icccd8435e20bdf270c03da5614e0d58f172c9f75
This commit is contained in:
Thomas Goirand
2025-03-13 10:23:12 +01:00
committed by Takashi Kajinami
parent d2ed6edfb7
commit ef626268d6
4 changed files with 33 additions and 0 deletions

View File

@@ -57,6 +57,14 @@
# (Optional) Use quorum queues for transients queues in RabbitMQ. # (Optional) Use quorum queues for transients queues in RabbitMQ.
# Defaults to $facts['os_service_default'] # Defaults to $facts['os_service_default']
# #
# [*rabbit_transient_queues_ttl*]
# (Optional) Positive integer representing duration in seconds for
# queue TTL (x-expires). Queues which are unused for the duration
# of the TTL are automatically deleted.
# The parameter affects only reply and fanout queues. (integer value)
# Min to 1
# Defaults to $facts['os_service_default']
#
# [*rabbit_quorum_delivery_limit*] # [*rabbit_quorum_delivery_limit*]
# (Optional) Each time a message is rdelivered to a consumer, a counter is # (Optional) Each time a message is rdelivered to a consumer, a counter is
# incremented. Once the redelivery count exceeds the delivery limit # incremented. Once the redelivery count exceeds the delivery limit
@@ -95,6 +103,10 @@
# (Optional) Specifies the number of messages to prefetch. # (Optional) Specifies the number of messages to prefetch.
# Defaults to $facts['os_service_default'] # Defaults to $facts['os_service_default']
# #
# [*amqp_auto_delete*]
# (Optional) Define if transient queues should be auto-deleted (boolean value)
# Defaults to $facts['os_service_default']
#
# [*amqp_durable_queues*] # [*amqp_durable_queues*]
# (optional) Define queues as "durable" to rabbitmq. # (optional) Define queues as "durable" to rabbitmq.
# Defaults to $facts['os_service_default'] # Defaults to $facts['os_service_default']
@@ -187,11 +199,13 @@ class barbican(
$rabbit_ha_queues = $facts['os_service_default'], $rabbit_ha_queues = $facts['os_service_default'],
$rabbit_quorum_queue = $facts['os_service_default'], $rabbit_quorum_queue = $facts['os_service_default'],
$rabbit_transient_quorum_queue = $facts['os_service_default'], $rabbit_transient_quorum_queue = $facts['os_service_default'],
$rabbit_transient_queues_ttl = $facts['os_service_default'],
$rabbit_quorum_delivery_limit = $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_length = $facts['os_service_default'],
$rabbit_quorum_max_memory_bytes = $facts['os_service_default'], $rabbit_quorum_max_memory_bytes = $facts['os_service_default'],
$rabbit_enable_cancel_on_failover = $facts['os_service_default'], $rabbit_enable_cancel_on_failover = $facts['os_service_default'],
$amqp_durable_queues = $facts['os_service_default'], $amqp_durable_queues = $facts['os_service_default'],
$amqp_auto_delete = $facts['os_service_default'],
$queue_enable = $facts['os_service_default'], $queue_enable = $facts['os_service_default'],
$queue_namespace = $facts['os_service_default'], $queue_namespace = $facts['os_service_default'],
$queue_topic = $facts['os_service_default'], $queue_topic = $facts['os_service_default'],
@@ -232,6 +246,7 @@ class barbican(
kombu_reconnect_delay => $kombu_reconnect_delay, kombu_reconnect_delay => $kombu_reconnect_delay,
kombu_failover_strategy => $kombu_failover_strategy, kombu_failover_strategy => $kombu_failover_strategy,
amqp_durable_queues => $amqp_durable_queues, amqp_durable_queues => $amqp_durable_queues,
amqp_auto_delete => $amqp_auto_delete,
kombu_compression => $kombu_compression, kombu_compression => $kombu_compression,
kombu_ssl_ca_certs => $kombu_ssl_ca_certs, kombu_ssl_ca_certs => $kombu_ssl_ca_certs,
kombu_ssl_certfile => $kombu_ssl_certfile, kombu_ssl_certfile => $kombu_ssl_certfile,
@@ -240,6 +255,7 @@ class barbican(
rabbit_ha_queues => $rabbit_ha_queues, rabbit_ha_queues => $rabbit_ha_queues,
rabbit_quorum_queue => $rabbit_quorum_queue, rabbit_quorum_queue => $rabbit_quorum_queue,
rabbit_transient_quorum_queue => $rabbit_transient_quorum_queue, rabbit_transient_quorum_queue => $rabbit_transient_quorum_queue,
rabbit_transient_queues_ttl => $rabbit_transient_queues_ttl,
rabbit_quorum_delivery_limit => $rabbit_quorum_delivery_limit, rabbit_quorum_delivery_limit => $rabbit_quorum_delivery_limit,
rabbit_quorum_max_memory_length => $rabbit_quorum_max_memory_length, rabbit_quorum_max_memory_length => $rabbit_quorum_max_memory_length,
rabbit_quorum_max_memory_bytes => $rabbit_quorum_max_memory_bytes, rabbit_quorum_max_memory_bytes => $rabbit_quorum_max_memory_bytes,

View File

@@ -0,0 +1,5 @@
---
features:
- |
Add a new ``amqp_auto_delete`` parameter, so that transient queues are
automatically deleted.

View File

@@ -0,0 +1,6 @@
---
features:
- |
A new parameter ``rabbit_transient_queues_ttl`` has been added to the
barbican init class to configure how long transient queue should stay until
they are automatically deleted.

View File

@@ -62,6 +62,7 @@ describe 'barbican' do
:kombu_reconnect_delay => '<SERVICE DEFAULT>', :kombu_reconnect_delay => '<SERVICE DEFAULT>',
:kombu_failover_strategy => '<SERVICE DEFAULT>', :kombu_failover_strategy => '<SERVICE DEFAULT>',
:amqp_durable_queues => '<SERVICE DEFAULT>', :amqp_durable_queues => '<SERVICE DEFAULT>',
:amqp_auto_delete => '<SERVICE DEFAULT>',
:kombu_compression => '<SERVICE DEFAULT>', :kombu_compression => '<SERVICE DEFAULT>',
:kombu_ssl_ca_certs => '<SERVICE DEFAULT>', :kombu_ssl_ca_certs => '<SERVICE DEFAULT>',
:kombu_ssl_certfile => '<SERVICE DEFAULT>', :kombu_ssl_certfile => '<SERVICE DEFAULT>',
@@ -70,6 +71,7 @@ describe 'barbican' do
:rabbit_ha_queues => '<SERVICE DEFAULT>', :rabbit_ha_queues => '<SERVICE DEFAULT>',
:rabbit_quorum_queue => '<SERVICE DEFAULT>', :rabbit_quorum_queue => '<SERVICE DEFAULT>',
:rabbit_transient_quorum_queue => '<SERVICE DEFAULT>', :rabbit_transient_quorum_queue => '<SERVICE DEFAULT>',
:rabbit_transient_queues_ttl => '<SERVICE DEFAULT>',
:rabbit_quorum_delivery_limit => '<SERVICE DEFAULT>', :rabbit_quorum_delivery_limit => '<SERVICE DEFAULT>',
:rabbit_quorum_max_memory_length => '<SERVICE DEFAULT>', :rabbit_quorum_max_memory_length => '<SERVICE DEFAULT>',
:rabbit_quorum_max_memory_bytes => '<SERVICE DEFAULT>', :rabbit_quorum_max_memory_bytes => '<SERVICE DEFAULT>',
@@ -96,11 +98,13 @@ describe 'barbican' do
:rabbit_ha_queues => true, :rabbit_ha_queues => true,
:rabbit_quorum_queue => true, :rabbit_quorum_queue => true,
:rabbit_transient_quorum_queue => true, :rabbit_transient_quorum_queue => true,
:rabbit_transient_queues_ttl => 60,
:rabbit_quorum_delivery_limit => 3, :rabbit_quorum_delivery_limit => 3,
:rabbit_quorum_max_memory_length => 5, :rabbit_quorum_max_memory_length => 5,
:rabbit_quorum_max_memory_bytes => 1073741824, :rabbit_quorum_max_memory_bytes => 1073741824,
:rabbit_enable_cancel_on_failover => false, :rabbit_enable_cancel_on_failover => false,
:amqp_durable_queues => true, :amqp_durable_queues => true,
:amqp_auto_delete => true,
:queue_enable => true, :queue_enable => true,
:queue_namespace => 'barbican1', :queue_namespace => 'barbican1',
:queue_topic => 'barbican1.workers', :queue_topic => 'barbican1.workers',
@@ -145,6 +149,7 @@ describe 'barbican' do
:kombu_reconnect_delay => params[:kombu_reconnect_delay], :kombu_reconnect_delay => params[:kombu_reconnect_delay],
:kombu_failover_strategy => params[:kombu_failover_strategy], :kombu_failover_strategy => params[:kombu_failover_strategy],
:amqp_durable_queues => params[:amqp_durable_queues], :amqp_durable_queues => params[:amqp_durable_queues],
:amqp_auto_delete => params[:amqp_auto_delete],
:kombu_compression => params[:kombu_compression], :kombu_compression => params[:kombu_compression],
:kombu_ssl_ca_certs => params[:kombu_ssl_ca_certs], :kombu_ssl_ca_certs => params[:kombu_ssl_ca_certs],
:kombu_ssl_certfile => params[:kombu_ssl_certfile], :kombu_ssl_certfile => params[:kombu_ssl_certfile],
@@ -153,6 +158,7 @@ describe 'barbican' do
:rabbit_ha_queues => params[:rabbit_ha_queues], :rabbit_ha_queues => params[:rabbit_ha_queues],
:rabbit_quorum_queue => params[:rabbit_quorum_queue], :rabbit_quorum_queue => params[:rabbit_quorum_queue],
:rabbit_transient_quorum_queue => params[:rabbit_transient_quorum_queue], :rabbit_transient_quorum_queue => params[:rabbit_transient_quorum_queue],
:rabbit_transient_queues_ttl => params[:rabbit_transient_queues_ttl],
:rabbit_quorum_delivery_limit => params[:rabbit_quorum_delivery_limit], :rabbit_quorum_delivery_limit => params[:rabbit_quorum_delivery_limit],
:rabbit_quorum_max_memory_length => params[:rabbit_quorum_max_memory_length], :rabbit_quorum_max_memory_length => params[:rabbit_quorum_max_memory_length],
:rabbit_quorum_max_memory_bytes => params[:rabbit_quorum_max_memory_bytes], :rabbit_quorum_max_memory_bytes => params[:rabbit_quorum_max_memory_bytes],