简体   繁体   English

Kafka/questDB JDBC 接收器连接器:未使用“topics.regex”创建的表

[英]Kafka/questDB JDBC Sink Connector: tables not created using "topics.regex"

I am using "confluentinc/kafka-connect-jdbc:10.2.6" as my JDBC connector to transfer Kafka topics into my questDB.我使用“confluentinc/kafka-connect-jdbc:10.2.6”作为我的 JDBC 连接器将 Kafka 主题传输到我的 questDB 中。

When I provide explicit topic names it is working as expected.当我提供明确的主题名称时,它按预期工作。 But when I use topic names based on regex then it's not working, the tables are not being created in my questDB database.但是,当我使用基于正则表达式的主题名称时,它不起作用,我的 questDB 数据库中没有创建表。

What am I missing in my JDBC settings?我的 JDBC 设置中缺少什么?

Thanks!谢谢!

explicit version (working):显式版本(工作):

{
  "name": "jdbc_sink_ftx",
  "config": {
    "connector.class": "io.confluent.connect.jdbc.JdbcSinkConnector",
    "topics": "trades-FTX-ETH-USD-PERP, trades-FTX-FTM-USD-PERP",
    "table.name.format": "${topic}",
    "connection.url": "jdbc:postgresql://questdb:8812/qdb?useSSL=false",
    "connection.user": "admin",
    "connection.password": "quest",
    "auto.create": "true",
    "insert.mode": "insert",
    "dialect.name": "PostgreSqlDatabaseDialect"
  }
}

regex-version (not working):正则表达式版本(不工作):

{
  "name": "jdbc_sink_ftx_regex",
  "config": {
    "connector.class": "io.confluent.connect.jdbc.JdbcSinkConnector",
    "topics.regex": "FTX",
    "table.name.format": "${topic}",
    "connection.url": "jdbc:postgresql://questdb:8812/qdb?useSSL=false",
    "connection.user": "admin",
    "connection.password": "quest",
    "auto.create": "true",
    "insert.mode": "insert",
    "dialect.name": "PostgreSqlDatabaseDialect"
  }
}

It would be best to check QuestDB logs.最好检查 QuestDB 日志。 Grepping for ' E ' should show errors that usually include description and OS error code in this case.在这种情况下,搜索' E '应显示通常包括描述和操作系统错误代码的错误。 Topic names in Kafka Connector are used as table names. Kafka 连接器中的主题名称用作表名称。 QuestDB uses table names as directories on disk and validates them for security purposes. QuestDB 使用表名作为磁盘上的目录并出于安全目的对其进行验证。 '.', '/' and '' are not allowed characters in table name. '.'、'/' 和 '' 不允许在表名中使用字符。 Specific OS can also apply additional restrictions on file names.特定的操作系统也可以对文件名应用额外的限制。

It would be best to check QuestDB logs though.不过最好检查 QuestDB 日志。

The regex needs to match with the complete topic names like so:正则表达式需要与完整的主题名称匹配,如下所示:

"topics.regex": "trades-FTX-.*"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM