What is the complete solution of mirrormaker2?

The flow I think goes like this (clusters named A and B):

  1. Start consumption from A’s topic1 topic, then B generates A.topic1 topic and synchronizes messages
  2. If cluster A hangs up, the consumer switches from topic1 of A to A.topic1 of B, and uses the mirror-client api to obtain the original consumption progress, and then consumes. The problem is that the producer’s message is sent to B’s A.topic1 or B’s topic1?
    Assuming that it is sent to A.topic1, after A gets up, it will not synchronize messages from A.topic1 of B. Only A(topic1)=>B(A.topic1), not B(A.topic1)=>A (topic1).
    Assuming another way, the producer sends to topic1 of B, how to ensure that the messages in A.topic1 in cluster B are consumed before topic1? Consuming topic1 and A.topic1 of cluster B at the same time will also cause the problem of consumption order.

This would create an endless loop of B(A.topic1)=>A (topic1)=>B(A.topic1)=>A (topic1)=> ...

So, no MirrorMaker2 explicitly disallows this to happen.


ensure that the messages in A.topic1 in cluster B are consumed before topic1

You cannot guarantee ordering across multiple topics, regardless. This isn’t a problem that can be addressed by MirrorMaker. Your app would need to do ordering at runtime before processing the data, assuming that order really is important.