How to remove messages from target cluster in blue/green deployment when message is ack in source cluster? #14893
-
Community Support Policy
RabbitMQ version usedother (please specify) Erlang version used26.1.x Operating system (distribution) usedRPM/DEB How is RabbitMQ deployed?Generic binary package rabbitmq-diagnostics status outputSee https://www.rabbitmq.com/docs/cli to learn how to use rabbitmq-diagnostics 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 clusterDonwload tar.gz on each node and run and form cluster Steps to reproduce the behavior in questionenable rabbitmq_federation plugin, publish and ack message 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 BACKTICKSKubernetes deployment file# Relevant parts of K8S deployment that demonstrate how RabbitMQ is deployed
# PASTE YAML HERE, BETWEEN BACKTICKSWhat problem are you trying to solve?I am currently running a blue/green deployment with RabbitMQ, consisting of 3 nodes in each cluster. I have set up federation between both clusters using the rabbitmq_federation plugin. My requirement is to remove a message from the target cluster once it has been acknowledged in the source cluster. I realize that the rabbitmq_federation plugin is not designed to handle this, as it creates a separate copy of the message and sends it to the target cluster, resulting in two independent messages. I am aware that setting up a message TTL on the target cluster can control this, but I am specifically looking for a solution that allows the removal of messages from the target cluster once they are acknowledged in the source cluster, without relying on message TTL. Is there any alternative approach or plugin that can help achieve this? Or any recommended best practices to fulfill this requirement? Thank you for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
|
The plugin you're looking for is shovel https://www.rabbitmq.com/docs/shovel |
Beta Was this translation helpful? Give feedback.
-
|
Queue federation will gradually move messages as the Blue-Green Deployment doc guide plus a blog post on the topic from 2025 explain. You can use shovels and create them programmatically, then delete them programmatically (or decommission the entire original cluster) but Blue-Green Deployments usually rely on queue federation. |
Beta Was this translation helpful? Give feedback.
Queue federation moves messages from the upstream cluster to the local one, it does not replicate messages (like exchange federation does).
If you follow the Blue-Green deployment guide and do not deploy publishers to both clusters in parallel, there should be no duplicates but as a general rule, your consumers should be ready to handle them even then.