Skip to content

Timestamp type clarification in ConsumerRecord #955

@fd8s0

Description

@fd8s0

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions