Tag:Old road

  • Talk about auto commit of Kafka client

    Time:2021-7-29

    order This article mainly talks about the implementation of auto commit of Kafka client maven <dependency> <groupId>org.apache.kafka</groupId> <artifactId>kafka-clients</artifactId> <version>0.10.2.1</version> </dependency> poll kafka-clients-0.10.2.1-sources.jar!/org/apache/kafka/clients/consumer/KafkaConsumer.java public ConsumerRecords<K, V> poll(long timeout) { acquire(); try { if (timeout < 0) throw new IllegalArgumentException(“Timeout must not be negative”); if (this.subscriptions.hasNoSubscriptionOrUserAssignment()) throw new IllegalStateException(“Consumer is not subscribed to any topics or assigned […]