Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

please help me! I encountered difficulties using the "AdminClient. list_offsets" method #1696

Open
6 of 7 tasks
testerHD opened this issue Dec 29, 2023 · 0 comments
Open
6 of 7 tasks

Comments

@testerHD
Copy link

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:

  • confluent-kafka-python and librdkafka version: 2.3.0
  • Apache Kafka broker version: 2.8
  • Client configuration: {'bootstrap.servers': xxx, 'security.protocol': 'SASL_PLAINTEXT', 'sasl.mechanism': 'SCRAM-SHA-256', 'sasl.username': xxx, 'sasl.password': xxx}
  • Operating system: Windows 11
  • Provide client logs (with 'debug': '..' as necessary)
  • Provide broker log excerpts
  • Critical issue
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

No branches or pull requests

1 participant