Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-12541

AdminClient.listOffsets should return the offset for the record with highest timestamp

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: admin
    • Labels:
      None

      Description

      In Kafka 2.7 the following method was added to AdminClient that provides this information:

      public ListOffsetsResult listOffsets(Map<TopicPartition,OffsetSpec> topicPartitionOffsets,
                                           ListOffsetsOptions options)

      https://kafka.apache.org/27/javadoc/org/apache/kafka/clients/admin/KafkaAdminClient.html#listOffsets-java.util.Map-org.apache.kafka.clients.admin.ListOffsetsOptions-

      where OffsetSpec can be:

      • OffsetSpec.EarliestSpec
      • OffsetSpec.LatestSpec
      • OffsetSpec.TimestampSpec

       
      This ticket introduces a new spec:

      OffsetSpec.MaxTimestampSpec // this returns the offset and timestamp for the record with the highest timestamp.

      This indicates to the AdminClient that we want to fetch the timestamp and offset for the record with the largest timestamp produced to a partition.

        Attachments

          Activity

            People

            • Assignee:
              tom@confluent.io Tom Scott
              Reporter:
              tom@confluent.io Tom Scott
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: