taosdata / kafka-connect-tdengine

GNU Affero General Public License v3.0
15 stars 5 forks source link

使用REST连接时报错user is required #54

Open XieRW opened 11 months ago

XieRW commented 11 months ago

connect.log日志如下:

java.sql.SQLException: ERROR (0x2319): user is required
    at com.taosdata.jdbc.TSDBError.createSQLException(TSDBError.java:87)
    at com.taosdata.jdbc.TSDBError.createSQLException(TSDBError.java:74)
    at com.taosdata.jdbc.rs.ConnectionParam.getParam(ConnectionParam.java:146)
    at com.taosdata.jdbc.SchemalessWriter.init(SchemalessWriter.java:109)
    at com.taosdata.jdbc.SchemalessWriter.<init>(SchemalessWriter.java:51)
    at com.taosdata.kafka.connect.db.CacheProcessor.schemalessInsert(CacheProcessor.java:80)
    at com.taosdata.kafka.connect.sink.TDengineSinkTask.bulkWriteBatch(TDengineSinkTask.java:108)
    at com.taosdata.kafka.connect.sink.TDengineSinkTask.put(TDengineSinkTask.java:85)
    at org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:601)
    at org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:350)
    at org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:250)
    at org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:219)
    at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:204)
    at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:259)
    at org.apache.kafka.connect.runtime.isolation.Plugins.lambda$withClassLoader$1(Plugins.java:236)
    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:750)

sink-demo.json:

{
  "name": "TDengineSinkConnector",
  "config": {
    "connector.class":"com.taosdata.kafka.connect.sink.TDengineSinkConnector",
    "tasks.max": "1",
    "topics": "meters",
    "connection.url": "jdbc:TAOS-RS://127.0.0.1:6041",
    "connection.user": "root",
    "connection.password": "taosdata",
    "connection.database": "power",
    "db.schemaless": "line",
    "data.precision": "ns",
    "key.converter": "org.apache.kafka.connect.storage.StringConverter",
    "value.converter": "org.apache.kafka.connect.storage.StringConverter",
    "errors.tolerance": "all",
    "errors.deadletterqueue.topic.name": "dead_letter_topic",
    "errors.deadletterqueue.topic.replication.factor": 1
  }
}

我将sink-demo.json其中的"connection.url": "jdbc:TAOS://127.0.0.1:6030"修改为"connection.url": "jdbc:TAOS-RS://127.0.0.1:6041?user=root&password=taosdata"就不会再出现问题了,怀疑是改成REST连接后,connection.user配置项不生效,只好在url上直接拼接了。

希望能验证这个问题并修复。

macbookpro2016 commented 7 months ago

用restful方式,将参数写在链接里之后消费kafka消息写入数据的时候会报args error 吗?

alwayslikethis777 commented 5 months ago

我也是用restful方式,然后提示找不到table name