You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a quick guide on how to manage RabbitMQ policies in RabbitMQ for PCF. We can make it extensible for any RabbitMQ, not necessarily for PCF, but the example and sample scripts provided in this guide are meant for PCF.
Prefer Policies over x-args
It is highly recommended that we do not pass any arguments (a.k.a x-args) when we declare AMQP queues or exchanges. Although the AMQP protocol allows us, it will not allow us to change those arguments afterwards. Say we declare a queue with a TTL of 60sec. Later on we decide that 60sec was too tight and we want it to be 90sec. Our application will fail to declare the queue with the new setting. There several ways to remedy this situation or on the other hand avoid it entirely.
To remedy the situation we would have to:
delete the entire if we dont care about losing the messages and let the application declare it again with the new settings
expliciting declaring the queues in the node where we want it to go,
or delegating to RabbitMQ to evenly distributed the queue for us
These two options are fully explained in the rabbitmq docs.
However it is important to understand that when nodes are restarted, say during a rolling upgrade, we may end up with an
unbalanced cluster. RabbitMQ will NOT automatically move queues in an attempt to obtain a balanced cluster.