Apache kafka Kafka日志压缩主题将密钥获取为null

Apache kafka Kafka日志压缩主题将密钥获取为null,apache-kafka,Apache Kafka,我在kafka集群中创建了一个日志压缩主题 我开始做这样的游戏机制作人 kafka-console-producer.sh --broker-list localhost:9091 --topic log-compaction-test --property print.key=true --property key.separator=, 它侦听新消息。现在如果我输入123,abc,它会立即抛出下面的错误 >[2019-09-01 22:12:55,897] WARN [Produce

我在kafka集群中创建了一个日志压缩主题

我开始做这样的游戏机制作人

kafka-console-producer.sh --broker-list localhost:9091 --topic log-compaction-test --property print.key=true --property key.separator=,
它侦听新消息。现在如果我输入123,abc,它会立即抛出下面的错误

>[2019-09-01 22:12:55,897] WARN [Producer clientId=console-producer] Got error produce response with correlation id 5 on topic-partition log-compaction-test-0, retrying (2 attempts left). Error: CORRUPT_MESSAGE (org.apache.kafka.clients.producer.internals.Sender)
[2019-09-01 22:12:56,030] WARN [Producer clientId=console-producer] Got error produce response with correlation id 6 on topic-partition log-compaction-test-0, retrying (1 attempts left). Error: CORRUPT_MESSAGE (org.apache.kafka.clients.producer.internals.Sender)
[2019-09-01 22:12:56,134] WARN [Producer clientId=console-producer] Got error produce response with correlation id 7 on topic-partition log-compaction-test-0, retrying (0 attempts left). Error: CORRUPT_MESSAGE (org.apache.kafka.clients.producer.internals.Sender)
[2019-09-01 22:12:56,243] ERROR Error when sending message to topic log-compaction-test with key: null, value: 8 bytes with error: (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback)
org.apache.kafka.common.errors.CorruptRecordException: This message has failed its CRC checksum, exceeds the valid size, has a null key for a compacted topic, or is otherwise corrupt.
我也试过这种方法。不走运

kafka-console-producer.sh --broker-list 0.0.0.0:9091 --topic log-compaction-test --property print.key=true --property key.separator=,
我做错了什么?我确实寄了钥匙。不知何故,卡夫卡认为它是空键


我为zookeeper和kafka经纪人使用docker容器

您使用了错误的属性-属性print.key=true。要解析键,必须传递parse.key=true:-property parse.key=true