apache-kafkaapache-kafka-connectstrimzi

Strimzi / Kafka Connect does not find my plugin


I'm using Strimzi, Kafka, Kafka Connect and a custom connector plugin, following this docs.

The deploy works fine, Kafka Connect is working, I can consume its RESTFUL API.

But the connector is not created. This is the error message:

Failed to find any class that implements Connector and which name matches org.company.MySourceConnector

I know the cause: it doesn't find the plugin (a jar file). But if I enter in the kafka-connect pod, I can see the jar file in the right (i suppose) place: /opt/kafka/plugins/my-source-connector/my-source-connector.jar.

Furthermore, I run cat /tmp/strimzi-connect.properties and I see the plugin path: plugin.path=/opt/kafka/plugins/. (the file is created by strimzi during deploy)

apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaConnect
metadata:
  name: kafka-connect
  annotations:
    strimzi.io/use-connector-resources: "true"
spec:
  replicas: 1
  bootstrapServers: kafka-kafka-bootstrap:9092
  image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
  config:
    group.id: connect-cluster
    ...

apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaConnector
metadata:
  name: my-connector
  labels:
    strimzi.io/cluster: kafka-connect
spec:
  class: org.company.MySourceConnector
  tasksMax: 1
  config:
    topic: my-topic
    name: my-connector

How do I configure Strimzi or Kafka Connect to find my plugin?

I exhausted all my resources. If someone could give some light on this, I would really appreciate it.


Solution

  • I found out that the jar file is corrupted.