我正在尝试为我的SQL Server表创建源连接器,这是一个示例:
{
"name": "test",
"config": {
"tasks.max":"1",
"connector.class": "io.confluent.connect.jdbc.JdbcSourceConnector",
"connection.url": "jdbc:sqlserver://REDACTED;databaseName=REDACTED",
"connection.user": "REDACTED",
"connection.password": "REDACTED",
"topic.prefix": "test",
"poll.interval.ms" : 2000,
"table.whitelist": "dbo.Client",
"mode":"incrementing",
"incrementing.column.name": "Id"
}
}
我遇到以下错误,但什么也没说...
java.lang.IllegalArgumentException: Number of groups must be positive.
at org.apache.kafka.connect.util.ConnectorUtils.groupPartitions(ConnectorUtils.java:41)
at io.confluent.connect.jdbc.JdbcSourceConnector.taskConfigs(JdbcSourceConnector.java:148)
at org.apache.kafka.connect.runtime.Worker.connectorTaskConfigs(Worker.java:305)
at org.apache.kafka.connect.runtime.distributed.DistributedHerder.reconfigureConnector(DistributedHerder.java:997)
at org.apache.kafka.connect.runtime.distributed.DistributedHerder.reconfigureConnectorTasksWithRetry(DistributedHerder.java:950)
at org.apache.kafka.connect.runtime.distributed.DistributedHerder.access$900(DistributedHerder.java:110)
at org.apache.kafka.connect.runtime.distributed.DistributedHerder$17$1.call(DistributedHerder.java:963)
at org.apache.kafka.connect.runtime.distributed.DistributedHerder$17$1.call(DistributedHerder.java:960)
at org.apache.kafka.connect.runtime.distributed.DistributedHerder.tick(DistributedHerder.java:270)
at org.apache.kafka.connect.runtime.distributed.DistributedHerder.run(DistributedHerder.java:219)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
当我将模式timestamp与timestamp.column.name(用datetimeoffset类型修改的列)一起使用时,也会发生同样的情况。
当我在自定义查询中使用模式批量时,效果很好。
有什么想法吗?