I following the Kafka quick start guide. I’m stuck as step 6 though, Import/Export your data as streams of Events…
https://kafka.apache.org/documentation/
The error indicates that Kafka can’t find the connector. I’ve added it to the connect-standalone.properties file in a variety of ways. Here is how I currently have it.
plugin.path=/home/ben/kafka/kafka_2.12-3.2.0/lib/connect-file-3.2.0.jar
I also tried pointing only to the libs folder.
I stopped the services and server, and restarted them as the guide instructs. Then I try to start the two connectors which read and write to the files.
bin/connect-standalone.sh config/connect-standalone.properties config/connect-file-source.properties config/connect-file-sink.properties
But it won’t start, and gives me this error.
[2022-06-18 18:06:16,006] ERROR Failed to create job for config/connect-file-source.properties (org.apache.kafka.connect.cli.ConnectStandalone:107)
[2022-06-18 18:06:16,020] ERROR Stopping after connector error (org.apache.kafka.connect.cli.ConnectStandalone:117)
java.util.concurrent.ExecutionException: org.apache.kafka.connect.errors.ConnectException: Failed to find any class that implements Connector and which name matches FileStreamSource, available connectors are: PluginDesc{klass=class org.apache.kafka.connect.mirror.MirrorCheckpointConnector, name='org.apache.kafka.connect.mirror.MirrorCheckpointConnector', version='3.2.0', encodedVersion=3.2.0, type=source, typeName='source', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.mirror.MirrorHeartbeatConnector, name='org.apache.kafka.connect.mirror.MirrorHeartbeatConnector', version='3.2.0', encodedVersion=3.2.0, type=source, typeName='source', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.mirror.MirrorSourceConnector, name='org.apache.kafka.connect.mirror.MirrorSourceConnector', version='3.2.0', encodedVersion=3.2.0, type=source, typeName='source', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.tools.MockSinkConnector, name='org.apache.kafka.connect.tools.MockSinkConnector', version='3.2.0', encodedVersion=3.2.0, type=sink, typeName='sink', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.tools.MockSourceConnector, name='org.apache.kafka.connect.tools.MockSourceConnector', version='3.2.0', encodedVersion=3.2.0, type=source, typeName='source', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.tools.SchemaSourceConnector, name='org.apache.kafka.connect.tools.SchemaSourceConnector', version='3.2.0', encodedVersion=3.2.0, type=source, typeName='source', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.tools.VerifiableSinkConnector, name='org.apache.kafka.connect.tools.VerifiableSinkConnector', version='3.2.0', encodedVersion=3.2.0, type=sink, typeName='sink', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.tools.VerifiableSourceConnector, name='org.apache.kafka.connect.tools.VerifiableSourceConnector', version='3.2.0', encodedVersion=3.2.0, type=source, typeName='source', location='classpath'}
So it seems I’m not pointing the properties to the connector correctly, although, among the variety of ways I’d tried, I also tried the relative path the guide instructs.
This is a new Ubuntu installation running Java 11. What am I missing here?
4
Answers
Look at:
I don’t know the details, but connect-file is excluded in the class path. Simply editing kafka-run-class.sh did the trick for me.
For confluent-7.2.2 the FileStreamSource connector is in the folder
/share/filestream-connectors
. Adding that to myplugin.path
worked for me.This answer builds off @John’s answer to provide a reference for those facing this issue on macOS Ventura with a Kafka installation done through Homebrew. For context, I encountered this error when trying to run a
FileStreamSource
connector example from Chapter 3 of Kafka in Action. In order to solve this issue, I made a copy of the fileopt/homebrew/opt/kafka/libexec/config/connect-standalone.properties
, edited the new file to have an additional key-value pair ofplugin.path=/opt/homebrew/opt/kafka/libexec/libs
and then invoked theconnect-standalone
binary on myPATH
with that edited properties file as the first argument instead of my Kafka installation’s defaultconnect-standalone.properties
file.just add
in your config/connect-standalone.properties file.