I am a newbie to Kafka and having problems experimenting with a supposedly simple Postgres database source using Kafka connect. I keep getting the following error:
“org.apache.kafka.connect.errors.ConnectException: java.sql.SQLException: No suitable driver found for jdbc:postgresql://localhost:5433/test”
The code I used to create the connector is as follows:
echo ‘{“name”:“postgres-login-connector”,“config”:{“connector.class”:“io.confluent.connect.jdbc.JdbcSourceConnector”,“connection.url”:“jdbc:postgresql://localhost:5432/test”,“connection.user”:“postgres”,“connection.password”:“xxxxx”,“table.whitelist”:“login”,“timestamp.column.name”:“created_at”,“poll.interval.ms”:“2000”,“ssl.mode”:“prefer”,“mode”:“bulk”,“topic.prefix”:“postgres.”}}’ | sudo curl -X POST -d @- http://localhost:8083/connectors --header “content-Type:application/json”
I have checked several times and ensured that the plugin.path includes a folder with both the kafka-connect-jdbc-10.2.6.jar and postgresql-42.2.19.jar, and all the other jars that comes with the download from confluent website.
The test database and the login table I am trying to source from do exist, I can see the table from pgAdmin4 and can also insert more records through psql using the username and password that I am putting into the connector.
What am I getting wrong here?