I am researching (experimenting with) a solution for data center failover, i.e. being able to consume messages from cluster B that were published to cluster A if cluster A dies. Since clustering does not work across data centers (across WAN), I envisioned the following that is not perfect but approximates the solution with a few caveats:
When messages are published to cluster A, they end up on the work queue in A via the exchange "work". When messages are published to cluster B, they end up on the work queue in B via the exchange also named "work". Exchanges and queues are named the same in both clusters because, ultimately, it's the same solution that is deployed several times for redundancy.
Then, I would federate "work" exchange from cluster A into "copy" exchange in cluster B. Note that I do not want to federate "work" in A to "work" in B because that would cause the messages processed twice -- once in A and second time in B. The "copy" exchange in B would have the "copy" queue bound to it. It will be a holding area for messages for when cluster A fails, in which case I would either start consumer to drain "copy" or shovel the messages from "copy" into "work". Since "copy" in B is not affected by consuming from "work" in A, it will keep accumulating messages, and, so, it would have high level message ttl set to expire messages that were presumably processed in A. I do understand that "copy" in B may not have all unprocessed messages as some may not have been yet delivered from A, or may have expired in B without being processed in A. "copy" in B may also have messages that were processed in A but not yet expired in B at the time of A dying, i.e. duplicates. I assume consumer is idempotent, so duplicates are ok. Some loss is assumed to be ok too -- better something than nothing in this case.
The same would apply to cluster B, i.e. "work" in B is replicated to "copy" in A via federation.
This is why I would like the upstream ("work") to be named differently from the downstream ("copy").
If upstream and downstream are named the same then I would have to have another exchange in A, say "workA", bound to "work" in A, have "workA" in A federated to "workA" in B, have "workB" in B bound to "work" in B, have "workB" in B federated to "workB" in A. Now, imagine I have one more data center... and one more ...
With upstream and downstream names matching each data center would have to have N+1 exchanges ("work", "work1", ... "workN"). With upstream name different from downstream, each data center would have exactly 2 exchanges: "work", meaning "my work", and "copy", meaning "other's work", and "copy" would be the downstream for multiple "work" upstreams.
I hope this made sense. I attached the picture of the two topologies.