...
- Add a CreateTime field to ProducerRecord. This field can be used by application to set the send time. It will also allow mirror maker to maintain the send time easily.
- Add both CreateTime and LogAppendTime to ConsumerRecord.
- The CreateTime is useful in use cases such as stream processing
- The LogAppendTime is useful in use cases such as log rolling and log retention.
Option 2 -
...
Add only LogAppendTime to the message
See Rejected Option Section
Option 3 -
...
Add only CreateTime to the message
While the time based log index has to be based on LogAppendTime, there is some concern about exposing the LogAppendTime (which is a broker internal concept) to user. And there will also be some per message overhead for two timestamps.
...
During step 2 and step 3, the majority of the consumers may be still using consumers using MessageAndOffset V0, broker could consume more memory.
Rejected Alternatives
Option 2 - Adding only LogAppendTime to the message
This proposal is pretty much the same as the selected proposal, except it does not include CreateTime in the message format.
...