Add flags for RabbitMQ message TTL & queue expiry
Adds two new flags to alter behaviour in RabbitMQ: * `rabbitmq_message_ttl_ms`, which lets you set a TTL on messages. * `rabbitmq_queue_expiry_ms`, which lets you set an expiry time on queues. See https://www.rabbitmq.com/ttl.html for more information on both. Change-Id: I51ca37ffbb1bb5c07f2d39873f0f33ca20263f2a
This commit is contained in:
parent
0d42110e01
commit
dae2cbca30
@ -99,6 +99,10 @@ rabbitmq_ha_promote_on_shutdown:
|
|||||||
# "ha-mode":"exactly","ha-params":{{ rabbitmq_ha_replica_count | int }}
|
# "ha-mode":"exactly","ha-params":{{ rabbitmq_ha_replica_count | int }}
|
||||||
rabbitmq_server_count: "{{ groups[role_rabbitmq_groups] | length }}"
|
rabbitmq_server_count: "{{ groups[role_rabbitmq_groups] | length }}"
|
||||||
rabbitmq_ha_replica_count: "{{ (rabbitmq_server_count | int // 2 + 1) }}"
|
rabbitmq_ha_replica_count: "{{ (rabbitmq_server_count | int // 2 + 1) }}"
|
||||||
|
# If no TTL is specified, messages will not expire
|
||||||
|
rabbitmq_message_ttl_ms:
|
||||||
|
# If no queue expiry is specified, queues will not expire
|
||||||
|
rabbitmq_queue_expiry_ms:
|
||||||
rabbitmq_extra_config: {}
|
rabbitmq_extra_config: {}
|
||||||
|
|
||||||
####################
|
####################
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
],
|
],
|
||||||
{% if om_enable_rabbitmq_high_availability | bool %}
|
{% if om_enable_rabbitmq_high_availability | bool %}
|
||||||
"policies":[
|
"policies":[
|
||||||
{"vhost": "/", "name": "ha-all", "pattern": "^(?!(amq\\.)|(.*_fanout_)|(reply_)).*", "apply-to": "all", "definition": {"ha-mode":{% if rabbitmq_ha_replica_count is not none %}"exactly","ha-params":{{ rabbitmq_ha_replica_count | int }}{% else %}"all"{% endif %}{% if rabbitmq_ha_promote_on_shutdown is not none %},"ha-promote-on-shutdown":"{{ rabbitmq_ha_promote_on_shutdown }}"{% endif %}}, "priority":0}{% if project_name == 'outward_rabbitmq' %},
|
{"vhost": "/", "name": "ha-all", "pattern": "^(?!(amq\\.)|(.*_fanout_)|(reply_)).*", "apply-to": "all", "definition": {"ha-mode":{% if rabbitmq_ha_replica_count is not none %}"exactly","ha-params":{{ rabbitmq_ha_replica_count | int }}{% else %}"all"{% endif %}{% if rabbitmq_ha_promote_on_shutdown is not none %},"ha-promote-on-shutdown":"{{ rabbitmq_ha_promote_on_shutdown }}"{% endif %}{% if rabbitmq_message_ttl_ms is not none %},"message-ttl":{{ rabbitmq_message_ttl_ms | int }}{% endif %}{% if rabbitmq_queue_expiry_ms is not none %},"expires":{{ rabbitmq_queue_expiry_ms }}{% endif %}}, "priority":0}{% if project_name == 'outward_rabbitmq' %},
|
||||||
{"vhost": "{{ murano_agent_rabbitmq_vhost }}", "name": "ha-all", "pattern": "^(?!(amq\\.)|(.*_fanout_)|(reply_)).*", "apply-to": "all", "definition": {"ha-mode":{% if rabbitmq_ha_replica_count is not none %}"exactly","ha-params":{{ rabbitmq_ha_replica_count | int }}{% else %}"all"{% endif %}{% if rabbitmq_ha_promote_on_shutdown is not none %},"ha-promote-on-shutdown":"{{ rabbitmq_ha_promote_on_shutdown }}"{% endif %}}, "priority":0}
|
{"vhost": "{{ murano_agent_rabbitmq_vhost }}", "name": "ha-all", "pattern": "^(?!(amq\\.)|(.*_fanout_)|(reply_)).*", "apply-to": "all", "definition": {"ha-mode":{% if rabbitmq_ha_replica_count is not none %}"exactly","ha-params":{{ rabbitmq_ha_replica_count | int }}{% else %}"all"{% endif %}{% if rabbitmq_ha_promote_on_shutdown is not none %},"ha-promote-on-shutdown":"{{ rabbitmq_ha_promote_on_shutdown }}"{% endif %}{% if rabbitmq_message_ttl_ms is not none %},"message-ttl":{{ rabbitmq_message_ttl_ms | int }}{% endif %}{% if rabbitmq_queue_expiry_ms is not none %},"expires":{{ rabbitmq_queue_expiry_ms }}{% endif %}}, "priority":0}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
]
|
]
|
||||||
{% else %}
|
{% else %}
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Added two new flags to alter behaviour in RabbitMQ:
|
||||||
|
* `rabbitmq_message_ttl_ms`, which lets you set a TTL on messages.
|
||||||
|
* `rabbitmq_queue_expiry_ms`, which lets you set an expiry time on queues.
|
||||||
|
See https://www.rabbitmq.com/ttl.html for more information on both.
|
@ -128,6 +128,9 @@ def check_json_j2():
|
|||||||
'kolla_internal_fqdn': '',
|
'kolla_internal_fqdn': '',
|
||||||
'octavia_provider_drivers': '',
|
'octavia_provider_drivers': '',
|
||||||
'rabbitmq_ha_replica_count': 2,
|
'rabbitmq_ha_replica_count': 2,
|
||||||
|
'rabbitmq_message_ttl_ms': 600000,
|
||||||
|
'rabbitmq_queue_expiry_ms': 3600000,
|
||||||
|
|
||||||
}
|
}
|
||||||
data = template.render(**context)
|
data = template.render(**context)
|
||||||
json.loads(data)
|
json.loads(data)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user