I setup two nodes, A and B. Both have RabbitMQ with the federation plugin installed.
From the Web UI, I can see the "Federation Status" > "State" is "running" on A and B.
On A, I created a queue called "test1".
On B, I can see the "test1" queue (replicated from A).
On A, I added a message.
However, the message does not appear in the replicated queue on B - the message stays on A.
This is the policy I used on A and B:
rabbitmqctl set_policy --apply-to exchanges my-queue "test1" \
'{"federation-upstream-set":"all"}'
So, it's like this: A (upstream) -> B (downstream) and B (upstream) -> A (downstream)
Am I supposed to see messages replicated to both A and B? Did I misconfigure the directions?
TL;DR: federated exchange != federated queue.
References:
The "How it works" section on federated queues explains:
Whereas the "What does a federated exchange do?" explains:
recap:
Use cases
Redundancy / Backups
Federated exchanges copy messages (
max-hops
copies) so they can be used for redundancy.E.g.
Content distribution network
Federated exchanges copy messages (
max-hops
copies) so they can be used to distribute content across regions (that's also redundancy btw) provided you configure the topology correctly.E.g.
Load balancing
Federated queues can be used for load balancing: if a message is available upstream and there is no consumer there to process it, a free consumer downstream is able to receive the message and work on it. Rock on.
E.g.
double-whammy
Federated exchange + federated queues = you can distribute the same set of tasks to multiple regions (cluster), and one worker in each cluster can perform the job.
E.g.