
pl.allegro.tech.hermes.management.infrastructure.kafka.service.LogEndOffsetChecker Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hermes-management Show documentation
Show all versions of hermes-management Show documentation
Fast and reliable message broker built on top of Kafka.
package pl.allegro.tech.hermes.management.infrastructure.kafka.service;
import java.util.Collections;
import org.apache.kafka.common.TopicPartition;
import pl.allegro.tech.hermes.common.kafka.KafkaConsumerPool;
public class LogEndOffsetChecker {
private final KafkaConsumerPool kafkaConsumerPool;
public LogEndOffsetChecker(KafkaConsumerPool kafkaConsumerPool) {
this.kafkaConsumerPool = kafkaConsumerPool;
}
public long check(TopicPartition topicPartition) {
return kafkaConsumerPool
.get(topicPartition.topic(), topicPartition.partition())
.endOffsets(Collections.singletonList(topicPartition))
.get(topicPartition);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy