user2111535
user2111535

Reputation: 27

Error while using Json Schema along with Schema registry in kafka connect

I am trying to use JsonSchema along with schema registry. It gives some code related bug.

Has anyone tried JsonSchema successfully.

java.lang.NoSuchMethodError: io.confluent.kafka.serializers.subject.strategy.SubjectNameStrategy.subjectName(Ljava/lang/String;ZLio/confluent/kafka/schemaregistry/ParsedSchema;)Ljava/lang/String;
    at io.confluent.kafka.serializers.AbstractKafkaSchemaSerDe.getSubjectName(AbstractKafkaSchemaSerDe.java:117)
    at io.confluent.connect.json.JsonSchemaConverter$Serializer.serialize(JsonSchemaConverter.java:135)
    at io.confluent.connect.json.JsonSchemaConverter.fromConnectData(JsonSchemaConverter.java:88)
    at org.apache.kafka.connect.storage.Converter.fromConnectData(Converter.java:63)
    at org.apache.kafka.connect.runtime.WorkerSourceTask.lambda$convertTransformedRecord$2(WorkerSourceTask.java:295)

Seems like there is getSubjectName function, but not subjectName

Upvotes: 1

Views: 1676

Answers (1)

Hemachand Manam
Hemachand Manam

Reputation: 11

This issue mostly occurs when you are trying different producers in the same Project. In our scenario, we ran Avro producer and Json producer in the same Project and Path.

After removing the Avro dependencies in the gradle build file, the Producer executed successfully. Also, make sure all the dependencies are added to maven/gradle.

Upvotes: 1

Related Questions