kafka-connect-datagen: Cannot use arbitrary AVRO schema file with datagen

Line https://github.com/confluentinc/kafka-connect-datagen/blob/0.1.x/src/main/java/io/confluent/kafka/connect/datagen/DatagenTask.java#L120 does not allow to use an arbitrary AVRO schema file at say /avro/product.avsc

Might want to use getClass().getResourceAsStream(schemaFilename) instead…

Java docu:

The methods in ClassLoader use the given String as the name of the resource without applying any absolute/relative transformation (cf. the methods in Class). The name should not have a leading “/”.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 39 (17 by maintainers)

Commits related to this issue

Most upvoted comments

If you’re running the connector inside a docker container, you need to copy the schema file into that container. If you’re using this docker-compose file, that’d be the container named connect.

Finally, it worked, thank you so much, i placed it in the broker and the schema registry containers before, but didn’t think it needed to be placed in the connect container, thank you again i’ve been stuck with this problem for more than 5 days

That’s great to hear! Glad I could help 😃

#25 has been validated by two users and merged. The updated kafka-connect-datagen version 0.1.2 has been posted to Confluent Hub: https://www.confluent.io/connector/kafka-connect-datagen/