I am interested in the following setup:
DC1: two nodes (node1 and node2) in a cluster
DC2: two nodes (node3 and node4) in a cluster
DC1 and DC2 are it two different geographical locations.
DC2 is essentially to be a mirror copy of DC1, sitting idle/standby unless DC1 were to completely go offline.
On node1 and node3, I set the following policy, which were replicated to their respective cluster partner:
rabbitmqctl set_policy ha-fed ".*" '{"federation-upstream-set":"all","ha-mode":"all"}'
On node1, via the management console, I defined the following Federation Upstream:
Name: rabbitdc2
URI: amqp://user:password@node3 amqp://user:password@node4
Expiry: 3600000ms
Ack mode: on-confirm
On node3, via the management console, I defined the following Federation Upstream:
Name: rabbitdc1
URI: amqp://user:password@node1 amqp://user:password@node2
Expiry: 3600000ms
Ack mode: on-confirm
Via the management console, I see Running Links via Federation Status as expected.
Next, I create a Queue named "test" on node1 via the management console. I see it automatically show up on node2, node3, and node4.
Next, I publish a message to the "test" queue on node1. I see the message mirror over to node2. But I do not see the message populate on node3 and node4.
Next, I want to consume the message and have the fact that it was consumed reflected on node3 and node4 as well.
I'm unclear as to what components I am missing for messages posted to a queue to replicate across the clusters. I read up a bit on
http://www.rabbitmq.com/federated-queues.html in the How It Works section and it seems that messages are only retrieved on a as needed basis. With that said, I ran the consumer against node4, even though it showed 0 messages in the test queue on that node, the messages were consumed. With that, I reposted the messages to the queue on node1, then shutdown node1 and node2 (the DC1 cluster) and now I'm not able to consume those messages from my DC2 cluster. I was hoping that with the shutdown of one of the nodes, the messages would sync between clusters. I'm missing something, but I'm not sure what at this point.
Thanks for the time
--
Kris