In the following example, I've used SQL Server AWS RDS SQL Server Express Edition. Adjust your parameters according to your environment.
For this example, I created a very simple table as
CREATE TABLE test (id INT PRIMARY KEY, value VARCHAR(255));
This is the example Connector config:
{
'connection.password': 'redacted',
'connection.url': 'jdbc:sqlserver://test-sql-server.cmnqmexvovar.us-east-1.rds.amazonaws.com:1433;databaseName=testdb;',
'connection.user': 'dbuser',
'connector.class': 'io.confluent.connect.jdbc.JdbcSourceConnector',
'errors.log.enable': 'false',
'errors.log.include.messages': 'false',
'incrementing.column.name': 'id',
'mode': 'incrementing',
'name': 'test-connector',
'numeric.precision.mapping': 'false',
'poll.interval.ms': '5000',
'table.poll.interval.ms': '120000',
'table.whitelist': 'test',
'tasks.max': '1',
'topic.prefix': 'data_',
'validate.non.null': 'true'
}
Once the connector is running, create a few records in the table:
INSERT INTO test (id, value) VALUES (1, 'Testing 1, 2, 3');
INSERT INTO test (id, value) VALUES (1, 'Testing a, b, c');
You can use Kafkacat to validate that the target topic is populated. See https://help.aiven.io/kafka/kafka-add-ons/using-kafkacat for our help article on Kafkacat.
$ kafkacat -F kafkacat.config -C -t data_test -p 0 -o 0 -e
{"id":1,"value":"Testing 1, 2, 3"}
{"id":2,"value":"Testing a, b, c"}
Got here by accident? Learn how Aiven simplifies working with Apache Kafka: