MirrorMaker 2
A second Kafka cluster beside the first, a MirrorMaker 2 that copies the event catalog's topics and the consumer group offsets from one to the other, and a consumer that fails over by changing its bootstrap address and resumes from the translated offset.
examples/34-mirrormaker-2/ is a manifest overlay on the shared minikube setup in examples/_k8s: the Kafka cluster edp, a second cluster edp-dr with one dual-role node, a KafkaMirrorMaker2 from edp to edp-dr, the Strimzi monitoring, and the order-service and notification-service. It accompanies MirrorMaker 2.
It uses kustomize through kubectl, Strimzi, Kafka, CloudNativePG, the LGTM image and the unchanged order-service and notification-service images.
cd examples/34-mirrormaker-2
./verify.sh
What to observe
- The same names.
edp.orders.placedexists on both clusters, with the same number of records, and the offset syncs and checkpoints sit in the internal topics the connectors use. - A group on the copy. The group
notification-serviceappears onedp-drwith the committed offsets it has onedp, before any consumer there has joined. - A failover that changes one setting.
notification-serviceis stopped, five more orders arrive, and the service started againstedp-drreads exactly those five. - A witness. With
OFFSET_SYNC=offthe group never appears onedp-dr.
Infrastructure
The cluster, PostgreSQL, LGTM, metrics and monitoring bases of examples/_k8s, the second cluster and the mirror, one dashboard, and the order-service and notification-service deployments.