RabbitMQ: Add support for quorum queue options

Depends-on: https://review.opendev.org/894866
Change-Id: If4ec390b7e484350b461f06eb05d85b8be5177c9
This commit is contained in:
Takashi Kajinami
2023-09-15 10:53:41 +09:00
parent 226f535109
commit 6699eb776c
2 changed files with 77 additions and 39 deletions

View File

@@ -61,6 +61,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']
@@ -194,6 +212,10 @@ class octavia (
$rabbit_heartbeat_timeout_threshold = $facts['os_service_default'],
$rabbit_heartbeat_rate = $facts['os_service_default'],
$rabbit_heartbeat_in_pthread = $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'],
$rabbit_ha_queues = $facts['os_service_default'],
$kombu_ssl_ca_certs = $facts['os_service_default'],
$kombu_ssl_certfile = $facts['os_service_default'],
@@ -252,6 +274,10 @@ class octavia (
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 { 'octavia_config':

View File

@@ -48,6 +48,10 @@ describe 'octavia' do
:kombu_ssl_ca_certs => '<SERVICE DEFAULT>',
:kombu_compression => '<SERVICE DEFAULT>',
:amqp_durable_queues => '<SERVICE DEFAULT>',
:rabbit_quorum_queue => '<SERVICE DEFAULT>',
:rabbit_quorum_delivery_limit => '<SERVICE DEFAULT>',
:rabbit_quorum_max_memory_length => '<SERVICE DEFAULT>',
:rabbit_quorum_max_memory_bytes => '<SERVICE DEFAULT>',
)
is_expected.to contain_oslo__messaging__amqp('octavia_config').with(
:server_request_prefix => '<SERVICE DEFAULT>',
@@ -88,6 +92,10 @@ describe 'octavia' do
:rabbit_heartbeat_timeout_threshold => '60',
:rabbit_heartbeat_rate => '10',
:rabbit_heartbeat_in_pthread => true,
:rabbit_quorum_queue => true,
:rabbit_quorum_delivery_limit => 3,
:rabbit_quorum_max_memory_length => 5,
:rabbit_quorum_max_memory_bytes => 1073741824,
:kombu_compression => 'gzip',
:kombu_reconnect_delay => '5.0',
:kombu_failover_strategy => 'shuffle',
@@ -121,6 +129,10 @@ describe 'octavia' do
:kombu_ssl_ca_certs => '<SERVICE DEFAULT>',
:kombu_compression => 'gzip',
:amqp_durable_queues => true,
:rabbit_quorum_queue => true,
:rabbit_quorum_delivery_limit => 3,
:rabbit_quorum_max_memory_length => 5,
:rabbit_quorum_max_memory_bytes => 1073741824,
)
should contain_oslo__messaging__notifications('octavia_config').with(
:transport_url => 'rabbit://rabbit_user:password@localhost:5673',