I have made the changes in server.properties file in Kafka 0.8.1.1 i.e. added log.cleaner.enable=true
and also enabled cleanup.policy=compact
while creating the topic.
Now when I am testing it, I pushed the following messages to the topic with following (Key, Message).
- Offset: 1 - (123, abc);
- Offset: 2 - (234, def);
- Offset: 3 - (345, ghi);
- Offset: 4 - (123, changed)
Now I pushed the 4th message with a same key as an earlier input, but changed the message. Here log compaction should come into picture. And using Kafka tool, I can see all the 4 offsets in the topic. How can I know whether log compaction is working or not? Should the earlier message be deleted, or the log compaction is working fine as the new message has been pushed.
Does it have to do anything with the log.retention.hours
or topic.log.retention.hours
or log.retention.size
configurations? What is the role of these configs in log compaction.
P.S. - I have thoroughly gone through the Apache Documentation, but still it is not clear.