Skip to content

[feat][client] Add Message::hasEventTimestamp - #631

Open
groeneai wants to merge 2 commits into
apache:mainfrom
groeneai:add-has-event-timestamp
Open

groeneai wants to merge 2 commits into
apache:mainfrom
groeneai:add-has-event-timestamp

Conversation

@groeneai

Copy link
Copy Markdown

Motivation

Message::getEventTimestamp returns 0 both when the producer set no event time and when it set the Unix epoch, so a consumer cannot tell the two apart. hasPartitionKey and hasOrderingKey already exist for the same reason.

Modifications

Add Message::hasEventTimestamp, which returns whether the message metadata has event_time.

Verifying this change

  • Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:

  • MessageTest.testHasEventTimestamp: a message without an event time, with an event time of 0 and with a non-zero one.

Documentation

  • doc-required
    (Your PR needs to update docs and you will update later)

  • doc-not-needed
    (Please explain why)
    The new method is documented in Message.h.

This fix comes from the fork of this repository that ClickHouse uses for its Pulsar table engine (ClickHouse/ClickHouse#64184).

🤖 Generated with Claude Code

alexey-milovidov and others added 2 commits November 13, 2026 23:38
`getEventTimestamp` returns 0 both when the producer set no event time and
when it explicitly set the Unix epoch. Add `hasEventTimestamp`, mirroring the
existing `hasPartitionKey`/`hasOrderingKey`, so callers can tell the two apart.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants