Python consumer TIMESTAMP_ flags as ints

Hello,

Can anyone confirm what is the integer representation of the flags described in the documentation regarding the timestamp field on the consumed message? I want to implement different behavior based on the returned integer.

https://docs.confluent.io/platform/current/clients/confluent-kafka-python/html/index.html#confluent_kafka.Message.timestamp

Is it as simple as this?

TIMESTAMP_NOT_AVAILABLE -> 0
TIMESTAMP_CREATE_TIME -> 1
TIMESTAMP_LOG_APPEND_TIME -> 2

Many thanks in advance!

Answering my own question: I did not realise these constants were available at the module level, so I could import them directly from confluent_kafka. Indeed, the assumed mappings were correct, i.e.

TIMESTAMP_NOT_AVAILABLE -> 0
TIMESTAMP_CREATE_TIME -> 1
TIMESTAMP_LOG_APPEND_TIME -> 2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.