How to set Stream retention policy #13241
-
Community Support Policy
RabbitMQ version usedother (please specify) Erlang version used27.2.x Operating system (distribution) usedLinux How is RabbitMQ deployed?Other rabbitmq-diagnostics status outputStatus of node [email protected] ... OS PID: 62 Plugins Enabled plugin file: /etc/rabbitmq/enabled_plugins
Data directory Node data directory: /var/rabbitmq/data/[email protected] Config files
Log file(s)
Alarms (none) Memory Total memory used: 7.0954 gb File Descriptors Total: 32105, limit: 1048479 Free Disk Space Low free disk space watermark: 0.05 gb Totals Connection count: 72 Listeners Interface: [::], port: 5551, protocol: stream/ssl, purpose: stream/ssl Logs from node 1 (with sensitive values edited out)See https://www.rabbitmq.com/docs/logging to learn how to collect logs
Logs from node 2 (if applicable, with sensitive values edited out)See https://www.rabbitmq.com/docs/logging to learn how to collect logs
Logs from node 3 (if applicable, with sensitive values edited out)See https://www.rabbitmq.com/docs/logging to learn how to collect logs
rabbitmq.confSee https://www.rabbitmq.com/docs/configure#config-location to learn how to find rabbitmq.conf file location
Steps to deploy RabbitMQ clusterrabbitmq is deployed as 3 node cluster. Steps to reproduce the behavior in questionI created the rabbitmq policy [root@rabbitmq-cluster-1 rabbitmq]# rabbitmqctl list_policies Now when I am trying to use the same , it throwing below error [root@rabbitmq-cluster-1 rabbitmq]# rabbitmq-streams set_stream_retention_policy gms2ita stream_retention Can any one help what I am doing wrong advanced.configSee https://www.rabbitmq.com/docs/configure#config-location to learn how to find advanced.config file location
Application code# PASTE CODE HERE, BETWEEN BACKTICKS Kubernetes deployment file# Relevant parts of K8S deployment that demonstrate how RabbitMQ is deployed
# PASTE YAML HERE, BETWEEN BACKTICKS What problem are you trying to solve?trying to set the stream retention policy but failed to do so |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
You just need to set up a policy. Do not use the By setting an appropriate regex in a policy you can target one or several streams and apply the retention with the On another note, you happily checked "I run RabbitMQ 4.x, the only series currently covered by community support" whereas the status output says "RabbitMQ version: 3.13.7". Let's consider it a honest mistake but please be more careful in the future. |
Beta Was this translation helpful? Give feedback.
-
And Once we set the policy, will it be honoured on existing streams .. Example I created a stream with 24 hour retention.. then I applied the retention policy for 1 hour... i would expect the messages other than 1 hour to be removed from the stream... Is the expectation correct. Is there any way/cli option to verify if the streams retention is being updated.. because even after the policy is applied.. the original retention shown in stream arguments is still 24 hours.. |
Beta Was this translation helpful? Give feedback.
-
Thanks that helps |
Beta Was this translation helpful? Give feedback.
You just need to set up a policy. Do not use the
set_stream_retention_policy
command (we will probably remove it in the future).By setting an appropriate regex in a policy you can target one or several streams and apply the retention with the
max-age
field.On another note, you happily checked "I run RabbitMQ 4.x, the only series currently covered by community support" whereas the status output says "RabbitMQ version: 3.13.7". Let's consider it a honest mistake but please be more careful in the future.