在哪里设置代理中 kafka 消息的最大生命周期?

where to set the max lifetime of kafka message in a broker?

在哪里设置 brokerkafka 条消息的最大值 lifetime?默认值是多少?

如果我结合Kafka使用Spark Streaming,这个设置有什么区别吗?

您可以使用以下命令在代理的 server.properties 文件中设置 kafka 主题的保留期(生命周期):

# The below configurations control the disposal of log segments. The policy can
# be set to delete segments after a period of time, or after a given size has accumulated.
# A segment will be deleted whenever *either* of these criteria are met. Deletion always happens
# from the end of the log.

# The minimum age of a log file to be eligible for deletion
log.retention.hours=168

# A size-based retention policy for logs. Segments are pruned from the log as long as the remaining
# segments don't drop below log.retention.bytes.
log.retention.bytes=1073741824