<p>I'm developing some custom topic name mapping and a jar file has been produced out of it.</p>
<p>And since I'm using MirrorMaker v1, these variables have also been added <code>KAFKA_MIRRORMAKER_MESSAGE_HANDLER</code> and <code>KAFKA_MIRRORMAKER_MESSAGE_HANDLER_ARGS</code> inside the KafkaMirrorMaker yaml file.</p>
<p>But I don't know how to physically add this custom jar file into the KafkaMirrorMaker pod. I have checked the CRD of the KafkaMirrorMaker but can't find any clue yet.</p>
<p>So, is there a way to let KafkaMirrorMaker download some file(s) / artifact(s) and include the jar file(s) into the classpath so that the custom MessageHandler can find it?</p>
<p>The helm install command is used to deploy the Mirror Maker. The apiVersion of the KafkaMirrorMaker I'm using currently: <code>kafka.strimzi.io/v1beta2</code></p>

Iwan Satria
<p>Based on the <code>strimzi</code> tag, I assume you use Strimzi's Mirror Maker v1? To add your own JAR, you would need to build a custom container image.</p>
<p>You could modify the Strimzi project sources and build everything from scratch (you can add your JAR as a dependency into the <em>3rd party libs</em> in `docker-images/kafka/...). But that is rather complicated as you build the whole project.</p>
<p>The easiest way is to just write your own Dockerfile and use the existing Strimzi image as a base image. For example:</p>
<pre><code>FROM quay.io/strimzi/kafka:0.26.0-kafka-3.0.0
USER root:root
COPY ./my-jar.jar /opt/kafka/libs/my-jar.jar
USER 1001
</code></pre>
<p>You can build this Dockerfile and push it into your own Docker registry (Docker Hub, Quay, whetever you use). You should make sure the <code>FROM</code> uses the right image based on the Strimzi version you use and KAfka version you use.</p>
<p>And once you have it, you have to tell Strimzi to use this image. You can do that either using the <code>.spec.image</code> option in the <code>KafkaMirrorMaker</code> custom resource. Or you can just change the environment variable <code>STRIMZI_KAFKA_MIRROR_MAKER_IMAGES</code> in the Strimzi Cluster Operator deployment and update the images which should be used there.</p>
