我正在使用JDBC接收器连接器将数据从kafka主题加载到postgres。这是我的配置
curl --location --request PUT 'http://localhost:8083/connectors/customer_sink_1/config' \
--header 'Content-Type: application/json' \
--data-raw '{
"connector.class": "io.confluent.connect.jdbc.JdbcSinkConnector",
"connection.url":"jdbc:postgresql://localhost:5432/postgres",
"connection.user":"user",
"connection.password":"passwd",
"tasks.max" : "1",
"topics":"table_name_same_as_topic_name",
"insert.mode":"insert",
"key.converter":"org.apache.kafka.connect.converters.ByteArrayConverter",
"value.converter":"org.apache.kafka.connect.json.JsonConverter",
"quote.sql.identifiers":"never",
"errors.tolerance":"all",
"errors.deadletterqueue.topic.name":"failed_records",
"errors.deadletterqueue.topic.replication.factor":"1",
"errors.log.enable":"true",
"errors.deadletterqueue.context.headers.enable":"true",
"reporter.bootstrap.servers":"localhost:9092",
"reporter.result.topic.name":"success-responses",
"reporter.result.topic.replication.factor":"1",
"reporter.error.topic.name":"error-responses",
"reporter.error.topic.replication.factor":"1"
}'我从windows上的apache kafka下载了kafka,并使用.bat文件来使用该服务。
我可以将失败的记录发送到其他主题,但当我尝试使用kafka-consumer从命令行使用它时,无法看到标题,但可以看到失败的数据/记录。
You can then use the **kcat** (formerly kafkacat) Utility to view the record header and determine why the record failed. Errors are also sent to **Connect Reporter**.因此,我尝试了Connect Reporter,但没有创建成功响应和错误响应主题。
如果没有kcat,我如何查看失败记录的标题?有可能吗??
发布于 2021-10-19 15:25:34
根据您的Kafka版本,您可以使用控制台消费者
kafka-console-consumer ... --property print.headers=true或者,如果不能使用kcat,也可以编写自己的使用者
https://stackoverflow.com/questions/69632105
复制相似问题