Related problem
KafkaMirrorMaker2 manages cross-cluster replication for DR, geo-distribution, and migration. It extends KafkaConnect internally and manages MirrorSourceConnector, MirrorCheckpointConnector, and MirrorHeartbeatConnector. Critical for multi-cluster production setups.
Suggested solution
New Tools
list_kafka_mirror_makers
- Parameters:
namespace (optional)
- Returns: List of MM2 instances: name, namespace, replicas (expected/ready), connect cluster name, source/target cluster names, status conditions
- K8s CRD:
kafkamirrormaker2s.kafka.strimzi.io
get_kafka_mirror_maker
- Parameters:
namespace (optional), mirrorMakerName (required)
- Returns: Detailed MM2: replicas, connect cluster, clusters list (name, bootstrapServers, authentication type, TLS), mirrors (source cluster, target cluster, topic selectors, group selectors, sync group offsets config, checkpoint/heartbeat config), image, status conditions, connector statuses (from CR status)
get_kafka_mirror_maker_logs
- Parameters:
namespace (optional), mirrorMakerName (required), filter/keywords/sinceMinutes/tailLines (optional)
- Returns: Aggregated MM2 pod logs with error analysis
- Pod selection:
strimzi.io/cluster={name}, strimzi.io/kind=KafkaMirrorMaker2
- Reuses:
LogCollectionService from common module
get_kafka_mirror_maker_pods
- Parameters:
namespace (optional), mirrorMakerName (required)
- Returns: Pod summaries (reuses
PodsService)
New Files
KafkaMirrorMaker2Service.java — @ApplicationScoped
KafkaMirrorMaker2Tools.java — @Singleton, @Guarded
KafkaMirrorMaker2Summary.java / KafkaMirrorMaker2Detail.java — DTOs
KafkaMirrorMaker2ServiceTest.java, KafkaMirrorMaker2ToolsTest.java
- Update
McpDiscoveryTest.java
RBAC
Add to 003-ClusterRole.yaml:
- apiGroups: ["kafka.strimzi.io"]
resources: ["kafkamirrormaker2s"]
verbs: ["get", "list", "watch"]
Key Notes
- MM2 extends KafkaConnect so the CR structure shares many fields — reuse patterns from KafkaConnect Tools
- Mirror config contains source/target cluster pairs with per-mirror topic and group selectors
- Connector statuses (source, checkpoint, heartbeat) are embedded in CR status
- Important to surface replication lag if available in connector status
Verification
mvn clean test — new tests pass
- Deploy MM2 on dev cluster with two Kafka clusters
- Invoke
list_kafka_mirror_makers, get_kafka_mirror_maker — verify cluster pairs and mirror configs
- Invoke
get_kafka_mirror_maker_logs — verify log collection
Related problem
KafkaMirrorMaker2 manages cross-cluster replication for DR, geo-distribution, and migration. It extends KafkaConnect internally and manages MirrorSourceConnector, MirrorCheckpointConnector, and MirrorHeartbeatConnector. Critical for multi-cluster production setups.
Suggested solution
New Tools
list_kafka_mirror_makersnamespace(optional)kafkamirrormaker2s.kafka.strimzi.ioget_kafka_mirror_makernamespace(optional),mirrorMakerName(required)get_kafka_mirror_maker_logsnamespace(optional),mirrorMakerName(required),filter/keywords/sinceMinutes/tailLines(optional)strimzi.io/cluster={name},strimzi.io/kind=KafkaMirrorMaker2LogCollectionServicefrom common moduleget_kafka_mirror_maker_podsnamespace(optional),mirrorMakerName(required)PodsService)New Files
KafkaMirrorMaker2Service.java—@ApplicationScopedKafkaMirrorMaker2Tools.java—@Singleton,@GuardedKafkaMirrorMaker2Summary.java/KafkaMirrorMaker2Detail.java— DTOsKafkaMirrorMaker2ServiceTest.java,KafkaMirrorMaker2ToolsTest.javaMcpDiscoveryTest.javaRBAC
Add to
003-ClusterRole.yaml:Key Notes
Verification
mvn clean test— new tests passlist_kafka_mirror_makers,get_kafka_mirror_maker— verify cluster pairs and mirror configsget_kafka_mirror_maker_logs— verify log collection