I encountered difficulties using the "AdminClient. list_offsets" method, I want to obtain the timestamp corresponding to the offset,
However, the timestamp obtained using the "result. timestamp" method is a negative timestamp(console: Timestamp: -1251536750), The timestamp of this message should be "1703850479000"
Description
Hello!
I encountered difficulties using the "AdminClient. list_offsets" method, I want to obtain the timestamp corresponding to the offset, However, the timestamp obtained using the "result. timestamp" method is a negative timestamp(console: Timestamp: -1251536750), The timestamp of this message should be "1703850479000"
The code is as follows:
topic_partition_offsets = dict()
topic_partition = TopicPartition(topic, partition)
topic_partition_offsets[topic_partition] = OffsetSpec.for_timestamp(1703847600000)
future_map = AdminClient({xxx}).list_offsets(topic_partition_offsets, request_timeout=15)
for tp, future in future_map.items():
result = future.result()
print(result.timestamp)
How to reproduce
Checklist
Please provide the following information:
2.3.0
2.8
{'bootstrap.servers': xxx, 'security.protocol': 'SASL_PLAINTEXT', 'sasl.mechanism': 'SCRAM-SHA-256', 'sasl.username': xxx, 'sasl.password': xxx}
Windows 11
'debug': '..'
as necessary)