Reputation: 289
he jdbc jar file for ibm db2 as400 is at the location:
/confluent-4.1.0/share/java/kafka-connect-jdbc\jt400.jar
I am trying to configure the source file from Json file
{
"name":"SOURCE_NAME",
"config":{
"connector.class":"io.confluent.connect.jdbc.JdbcSourceConnector",
"tasks.max":"1",
"topic.prefix":"TOPIC_NAME",
"connection.url":"jdbc:as400://IP_ADDRESS:PORT;libraries=DATABASE;",
"connection.user":"USER_NAME",
"connection.password":"PASSWORD",
"key.converter": "io.confluent.connect.avro.AvroConverter",
"key.converter.schema.registry.url": "http://localhost:8081",
"value.converter": "io.confluent.connect.avro.AvroConverter",
"value.converter.schema.registry.url": "http://localhost:8081",
"log4j.logger.io.confluent.connect.jdbc":"DEBUG",
"mode": "incrementing",
"incrementing.column.name": "ID",
"query": "SELECT * FROM TABLE",
"poll.interval.ms": "60000",
"batch.max.rows": "10000",
"table.types": "TABLE",
"plugin.path":"/confluent-4.1.0/share/java"
}
}
I am getting error
{"error_code":400,"message":"Connector configuration is invalid and contains the following 2 error(s):
Invalid value java.sql.SQLException: The application requester cannot establish the connection. (Connection refused (Connection refused)) for configuration Couldn't open connection to jdbc:as400://IP_ADDRESS:PORT/DATABASE
Invalid value java.sql.SQLException: The application requester cannot establish the connection. (Connection refused (Connection refused)) for configuration Couldn't open connection to jdbc:as400://IP_ADDRESS:PORT/DATABASE
You can also find the above list of errors at the endpoint `/{connectorType}/config/validate`"}
I had configured Connect sources for Microsoft SQL Server with success and configurations seem very similar. What could be going wrong here.
Upvotes: 0
Views: 1521
Reputation: 138
Right now Kafka-jdbc-connector(Confluent) does not supporting DB2 AS400/iseries. if you want to work with db2 AS400, add 'as400' in as400 dialect Providers, add dependecy 'jt400' in pom.xml and load the "com.ibm.as400.access.AS400JDBCDriver" in "GenericDatabaseDialect" class before establishing connection. Adding provider in DB2 Dialect
public Provider() {
super(Db2DatabaseDialect.class.getSimpleName(), "db2", "db2j", "ibmdb","as400");
}
Adding AS400 Jdbc driver in Generic Database Dialect
try {
Class.forName("com.ibm.as400.access.AS400JDBCDriver");
} catch (ClassNotFoundException e) {
throw new SQLException("AS400JDBC Driver Not found");
}
Upvotes: 0
Reputation: 66
As of now Kafka-Connect doesn't come with AS400 support. If you need AS400 support , kindly add AS400 under db2 dialect in JDBC connector and rebuild the connector
Upvotes: 1