尝试运行Kafka JDBC源连接器时为CORRUPT_MESSAGE

时间:2018-06-30 11:10:55

标签: apache-kafka apache-kafka-connect confluent

我正在尝试使用以下配置运行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)

1 个答案:

答案 0 :(得分:1)

我发现此错误与保留政策有关。

compact策略需要一个键和一个值。由于视图没有键,因此消息已损坏。将政策更改为delete可以解决此问题。