Interface KafkaConsumerTimingAdjuster

  • All Known Implementing Classes:
    WakingKafkaConsumerTimingAdjuster

    public interface KafkaConsumerTimingAdjuster
    Adjusts the consumption timing of the given consumer to try to have it consume the next message at a given time until due. Since the KafkaConsumer executes on a single thread, this is done in a best-effort basis.
    Since:
    2.7
    Author:
    Tomaz Fernandes
    See Also:
    KafkaConsumerBackoffManager
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      long adjustTiming​(org.apache.kafka.clients.consumer.Consumer<?,​?> consumerToAdjust, org.apache.kafka.common.TopicPartition topicPartitionToAdjust, long containerPollTimeout, long timeUntilNextMessageIsDue)
      Executes the timing adjustment.
    • Method Detail

      • adjustTiming

        long adjustTiming​(org.apache.kafka.clients.consumer.Consumer<?,​?> consumerToAdjust,
                          org.apache.kafka.common.TopicPartition topicPartitionToAdjust,
                          long containerPollTimeout,
                          long timeUntilNextMessageIsDue)
        Executes the timing adjustment.
        Parameters:
        consumerToAdjust - the consumer that will have consumption adjusted
        topicPartitionToAdjust - the consumer's topic partition to be adjusted
        containerPollTimeout - the consumer's container pollTimeout property
        timeUntilNextMessageIsDue - the time when the next message should be consumed
        Returns:
        the applied adjustment amount