我正在寻找有关如何将自定义转换器安装到kafka-connect节点上的建议,以便可以通过复制器连接器使用它。
我做了什么:
当我启动我的kafka连接复制器时,我看到罐子被拿起了,但是失败了
java.lang.LinkageError: loader constraint violation: when resolving field "schemaRegistry" the class loader (instance of org/apache/kafka/connect/runtime/isolation/PluginClassLoader) of the referring class, io/confluent/kafka/serializers/AbstractKafkaAvroSerDe, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for the field's resolved type, io/confluent/kafka/schemaregistry/client/SchemaRegistryClient, have different Class objects for that type
at io.confluent.connect.avro.AvroConverterLuke$Serializer.<init>(AvroConverterLuke.java:117)
at io.confluent.connect.avro.AvroConverterLuke$Serializer.<init>(AvroConverterLuke.java:123)
at io.confluent.connect.avro.AvroConverterLuke.configure(AvroConverterLuke.java:69)
at org.apache.kafka.connect.runtime.isolation.Plugins.newConverter(Plugins.java:263)
at org.apache.kafka.connect.runtime.Worker.startTask(Worker.java:412)
at org.apache.kafka.connect.runtime.standalone.StandaloneHerder.createConnectorTasks(StandaloneHerder.java:307)
at org.apache.kafka.connect.runtime.standalone.StandaloneHerder.updateConnectorTasks(StandaloneHerder.java:332)
at org.apache.kafka.connect.runtime.standalone.StandaloneHerder.putConnectorConfig(StandaloneHerder.java:210)
at org.apache.kafka.connect.cli.ConnectStandalone.main(ConnectStandalone.java:113)
很明显,我jar中包含的类与运行时Kafka Connect类存在某种冲突。
我的问题是,如何包装转换器,以便可以重用SchemaRegistryClient之类的类,但不会发生冲突?