Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add jar to general Kafka Connect classpath in the Confluent Docker

I am using the confluent docker for Kafka connect v4.1.1 and would like to add a jar with specific log4j appenders.
With the classpath isolation by connector, I am not sure where to place that jar in the confluent docker, as it is used by the parent kafka connect itself and not the connectors.

Thanks in advance for the help!

like image 959
Cherif Naggar Avatar asked Jun 14 '18 14:06

Cherif Naggar


1 Answers

If you want to add a jar that will be used by the Connect framework and is not specific to any of the connectors, you have the following options:

  1. Add the jar to the classpath with:

    -e CLASSPATH=/path/to/custom/library.jar

  2. Copy the jar directly to the directory that includes the Kafka Connect framework. In Confluent docker images this is currently:

    /usr/share/java/kafka

You need to make sure this jar is not in conflict with any of the dependencies of Kafka Connect.

like image 200
Konstantine Karantasis Avatar answered Nov 19 '22 04:11

Konstantine Karantasis