相关疑难解决方法(0)

日志压缩以确保每个键只保留一条消息

我想创建一个包含唯一键及其对应的最新值的主题。因此,当将带有现有键的消息插入主题时,旧消息将被删除。

为此,我在server.properties文件中配置了以下参数:

log.cleaner.enable=true
log.cleanup.policy=compact

# The minimum age of a log file to be eligible for deletion due to age
log.retention.minutes=3

log.retention.bytes=10737418

# The maximum size of a log segment file. When this size is reached a new log segment will be created.
log.segment.bytes=1073741

# The interval at which log segments are checked to see if they can be deleted according
# to the retention policies
log.retention.check.interval.ms=60000

# The maximum time before a new log segment is rolled …
Run Code Online (Sandbox Code Playgroud)

apache-kafka

6
推荐指数
1
解决办法
3821
查看次数

标签 统计

apache-kafka ×1