Kafka:启用日志压缩后,带有空键的消息会发生什么情况?
Kafka: What happens to message with null key when log compaction is enabled?
启用日志压缩后,带有空键的消息会发生什么情况?带有空键的消息是否被压缩?
在当前版本中是这样的:
"Currently when a user sends a null key to a log compacted topic, the broker returns CorruptRecordException, which is a retriable exception. As such, the producer keeps retrying until retries are exhausted or request.timeout.ms expires and eventually throws a TimeoutException."
如 Jira KIP-135 中所述,这有点令人困惑。
如果来自 KIP-135 的更清洁的解决方案(正如@运行 Lupvoich 指出的那样仍在讨论中)在未来被接受,则另一种行为应该如下:
When you try to produce null key to log compacted topic, Kafka should return a new error type INVALID_KEY
启用日志压缩后,带有空键的消息会发生什么情况?带有空键的消息是否被压缩?
在当前版本中是这样的:
"Currently when a user sends a null key to a log compacted topic, the broker returns CorruptRecordException, which is a retriable exception. As such, the producer keeps retrying until retries are exhausted or request.timeout.ms expires and eventually throws a TimeoutException."
如 Jira KIP-135 中所述,这有点令人困惑。
如果来自 KIP-135 的更清洁的解决方案(正如@运行 Lupvoich 指出的那样仍在讨论中)在未来被接受,则另一种行为应该如下:
When you try to produce null key to log compacted topic, Kafka should return a new error type INVALID_KEY