diff --git a/manifests/init.pp b/manifests/init.pp index d4a71f9..b958155 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -68,6 +68,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'] +# # [*rabbit_use_ssl*] # (Optional) Connect over SSL for rabbit # Defaults to $facts['os_service_default'] @@ -188,6 +206,10 @@ class magnum( $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_use_ssl = $facts['os_service_default'], $kombu_ssl_ca_certs = $facts['os_service_default'], $kombu_ssl_certfile = $facts['os_service_default'], @@ -231,19 +253,23 @@ class magnum( } oslo::messaging::rabbit { 'magnum_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, - amqp_durable_queues => $amqp_durable_queues, - kombu_compression => $kombu_compression, + 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, + amqp_durable_queues => $amqp_durable_queues, + kombu_compression => $kombu_compression, + 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 { 'magnum_config': diff --git a/releasenotes/notes/rabbit-quorum-queue-3b2e46f477ec2798.yaml b/releasenotes/notes/rabbit-quorum-queue-3b2e46f477ec2798.yaml new file mode 100644 index 0000000..653b8c3 --- /dev/null +++ b/releasenotes/notes/rabbit-quorum-queue-3b2e46f477ec2798.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + The ``magnum`` class now supports options for quorum queues in RabbitMQ. diff --git a/spec/classes/magnum_init_spec.rb b/spec/classes/magnum_init_spec.rb index 41f9a04..3495db3 100644 --- a/spec/classes/magnum_init_spec.rb +++ b/spec/classes/magnum_init_spec.rb @@ -32,19 +32,24 @@ describe 'magnum' do it 'configures rabbit' do is_expected.to contain_oslo__messaging__rabbit('magnum_config').with( - :rabbit_ha_queues => '', - :heartbeat_timeout_threshold => '', - :heartbeat_rate => '', - :heartbeat_in_pthread => '', - :rabbit_use_ssl => '', - :kombu_reconnect_delay => '', - :kombu_failover_strategy => '', - :kombu_ssl_version => '', - :kombu_ssl_keyfile => '', - :kombu_ssl_certfile => '', - :kombu_ssl_ca_certs => '', - :amqp_durable_queues => '', - :kombu_compression => '') + :rabbit_ha_queues => '', + :heartbeat_timeout_threshold => '', + :heartbeat_rate => '', + :heartbeat_in_pthread => '', + :rabbit_use_ssl => '', + :kombu_reconnect_delay => '', + :kombu_failover_strategy => '', + :kombu_ssl_version => '', + :kombu_ssl_keyfile => '', + :kombu_ssl_certfile => '', + :kombu_ssl_ca_certs => '', + :amqp_durable_queues => '', + :kombu_compression => '', + :rabbit_quorum_queue => '', + :rabbit_quorum_delivery_limit => '', + :rabbit_quorum_max_memory_length => '', + :rabbit_quorum_max_memory_bytes => '', + ) end it 'configures notifications' do @@ -71,6 +76,10 @@ describe 'magnum' do :rabbit_heartbeat_rate => 10, :rabbit_heartbeat_in_pthread => true, :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, } end @@ -89,19 +98,24 @@ describe 'magnum' do :control_exchange => 'magnum', ) is_expected.to contain_oslo__messaging__rabbit('magnum_config').with( - :rabbit_ha_queues => true, - :heartbeat_timeout_threshold => 60, - :heartbeat_rate => 10, - :heartbeat_in_pthread => true, - :rabbit_use_ssl => '', - :kombu_reconnect_delay => '', - :kombu_failover_strategy => 'shuffle', - :kombu_ssl_version => '', - :kombu_ssl_keyfile => '', - :kombu_ssl_certfile => '', - :kombu_ssl_ca_certs => '', - :amqp_durable_queues => true, - :kombu_compression => '') + :rabbit_ha_queues => true, + :heartbeat_timeout_threshold => 60, + :heartbeat_rate => 10, + :heartbeat_in_pthread => true, + :rabbit_use_ssl => '', + :kombu_reconnect_delay => '', + :kombu_failover_strategy => 'shuffle', + :kombu_ssl_version => '', + :kombu_ssl_keyfile => '', + :kombu_ssl_certfile => '', + :kombu_ssl_ca_certs => '', + :amqp_durable_queues => true, + :kombu_compression => '', + :rabbit_quorum_queue => true, + :rabbit_quorum_delivery_limit => 3, + :rabbit_quorum_max_memory_length => 5, + :rabbit_quorum_max_memory_bytes => 1073741824, + ) end it 'configures notifications' do