How do I install mssql jdbc driver to confluent / kafka

Refresh

April 2019

Views

544 time

1

I'm trying to create a connector through the rest and it won't work stating that "Failed to find any class that implements Connector and which name matches com.microsoft.sqlserver.jdbc.SQLServerDriver

I'm on ubuntu 16.04 and I've tried the following and each time i try something new i stop then start confluent with confluent stop confluenct start

download mssql-jdbc-6.2.2.jre8.jar

export CLASSPATH=/path/to/dir/* cp path/to/mssql-jdbc-6.2.2.jre8.jar /usr/share/rest-utils cp path/to/mssql-jdbc-6.2.2.jre8.jar /usr/share/java/kafka cp path/to/mssql-jdbc-6.2.2.jre8.jar /usr/share/java/kafka-connect-jdbc cp path/to/mssql-jdbc-6.2.2.jre8.jar /usr/share/java/res-utils cp path/to/mssql-jdbc-6.2.2.jre8.jar /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext

The documentation makes it seem like all i do is add /path/to/jar to to classpath and start confluent. What am i missing.

Further this is my json for creating the connector.

{
  "name": "jdbc-source",
  "config": {
    "connector.class": "com.microsoft.sqlserver.jdbc.SQLServerDriver",
    "tasks.max": "1",
    "connection.url": "jdbc:sqlserver://sql:1443;User=someone;Password=password;Database=some-deb",
    "mode": "incrementing",
    "incrementing.column.name": "id",
    "topic.prefix": "email",
    "topic.whitelist": "EventLog",
    "name": "jdbc-source"
  }
}

1 answers

0

Well it turns out that the connector.class should remain io.confluent.connect.jdbc.JdbcSourceConnector so I think these steps are sufficient.

  1. add your mssql-jdbc-6.2.2.jre8.jar to the CLASSPATH
  2. confluent start
  3. POST the config in the question and replace the connector.class with io.confluent.connect.jdbc.JdbcSourceConnector: i also had to remove the port