在配置Debezium Mysql连接器生成原始键而不是struct或json对象时,您可以按照以下步骤进行操作:
具体的配置如下:
{
"name": "mysql-connector",
"config": {
"connector.class": "io.debezium.connector.mysql.MySqlConnector",
"key.converter": "org.apache.kafka.connect.storage.StringConverter",
"key.converter.schemas.enable": "false",
"key.converter.schema.registry.url": "your-schema-registry-url",
"transforms": "unwrap",
"transforms.unwrap.type": "io.debezium.transforms.UnwrapFromEnvelope",
"database.hostname": "your-database-hostname",
"database.port": "your-database-port",
"database.user": "your-database-username",
"database.password": "your-database-password",
"database.server.id": "your-server-id",
"database.server.name": "your-database-server-name",
"database.whitelist": "your-database-whitelist",
"database.history.kafka.bootstrap.servers": "your-bootstrap-servers",
"database.history.kafka.topic": "your-history-topic"
}
}
配置说明:
这样配置后,Debezium Mysql连接器将生成原始键而不是struct或json对象。
腾讯云相关产品和产品介绍链接:
领取专属 10元无门槛券
手把手带您无忧上云