尝试运行kafka jdbc源连接器时损坏了\u消息

fcg9iug3  于 2021-06-08  发布在  Kafka
关注(0)|答案(1)|浏览(419)

我正在尝试使用以下配置运行kafka jdbc源连接器:

{
    "name": "source-mariadb-VIEW_GIORGOS", 
    "config": { "connector.class":"io.confluent.connect.jdbc.JdbcSourceConnector", 
                "tasks.max":"10", 
                "connection.url":"jdbc:mariadb://localhost:3306/kafka?user=myuser&password=mypass", 
                "table.whitelist":"VIEW_GIORGOS", 
                "mode":"timestamp", 
                "timestamp.column.name":"ROWVERSION", 
                "validate.non.null":"false", 
                "topic.prefix":"GIORGOS-", 
                "table.types":"TABLE,VIEW", 
                "poll.interval.ms":"1000",
                "consumer.group.id":"mytopicgroup1" 
    }
}

但是kafka connect报告了以下错误:

WARN [Producer clientId=producer-8] Got error produce response with correlation id 1504 on topic-partition GIORGOS-VW_GIORGOS, retrying (2147483149 attempts left). 
Error: CORRUPT_MESSAGE (org.apache.kafka.clients.producer.internals.Sender:526)
pkln4tw6

pkln4tw61#

我发现这个错误与保留策略有关。 compact 策略需要一个键和一个值。由于视图没有键,因此消息已损坏。将策略更改为 delete 为我解决了这个问题。

相关问题