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 theKafkaConsumer
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 adjustedtopicPartitionToAdjust
- the consumer's topic partition to be adjustedcontainerPollTimeout
- the consumer's container pollTimeout propertytimeUntilNextMessageIsDue
- the time when the next message should be consumed- Returns:
- the applied adjustment amount
-
-