Class KafkaConsumerUtil

java.lang.Object
org.apache.camel.processor.idempotent.kafka.KafkaConsumerUtil

public class KafkaConsumerUtil extends Object
  • Constructor Details

    • KafkaConsumerUtil

      public KafkaConsumerUtil()
  • Method Details

    • isReachedOffsets

      public static <K, V> boolean isReachedOffsets(org.apache.kafka.clients.consumer.Consumer<K,V> consumer, Map<org.apache.kafka.common.TopicPartition,Long> targetOffsets)
      Tests whether the Kafka consumer reached the target offsets for all specified topic partitions.
      Type Parameters:
      K - Key type.
      V - Value type.
      Parameters:
      consumer - Kafka consumer. It is expected to have some assignment to topic partitions.
      targetOffsets - Target offsets for topic partitions.
      Returns:
      true if the consumer has reached the target offsets for all specified topic partitions.