Timestamp type clarification in ConsumerRecord
fd8s0 opened this issue · 2 comments
I was hoping it was clearer to me why the Timestamp was chosen to be represented the way it is.
I find myself having to write this sort of thing
ts.logAppendTime
.orElse(ts.createTime)
.orElse(ts.unknownTime)
Trying to disassemble it every time to basically undo what's been done in the fromJava
method, is there some philosophy here that I'm missing? If I want to know the type of the timestamp I'm also supposed to do call for the option of each one in succession to try infer the type?
I'd have expected an optional timestamp with the type attached, I propose that maybe it can be re-thought, or perhaps get some peace of mind on what's the reasoning behind this.
I was also wondering about that - I was thinking about changing it in 3.0. Any thoughts on this @vlovgr ?
I agree we should change it. 👍