We have modified the Kafka Connect JDBC to support a custom converter which will convert a single SinkRecord into multiple SinkRecords so to support transactional inserts. When creating a sink, one might specify in the configuration properties a class that implements SinkRecordConverter
We then tried packaged a uber jar with the implementation of this custom converter and we tried to deploy it in two ways:
- We placed in the same folder of kafka-connect-jdbc
- We modified the plugins.path in the connect-distributed.properties to /usr/local/share/java and we placed our converter in /usr/local/share/java/myconverter/myconverter-1.0.jar
Then we tried to deploy the sink, but in both cases the code that tries to create an instance of this converter by reflection fails with a java.lang.ClassNotFoundException.
We tried to debug the classloading issue by placing a breakpoint where the issue occurs in both cases:
- In the first case the jar would appear as one of the jars on the URLClasspath
- In the second case, it would not even appears as one of the jars on the URLClasspath
What is the correct way to add custom converters to kafka-connect-jdbc?