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
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionlongadjustTiming(org.apache.kafka.clients.consumer.Consumer<?, ?> consumerToAdjust, org.apache.kafka.common.TopicPartition topicPartitionToAdjust, long containerPollTimeout, long timeUntilNextMessageIsDue) Executes the timing adjustment.
-
Method Details
-
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
-