Tag:Old road

  • Talk about auto commit of Kafka client


    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></version> </dependency> poll kafka-clients-!/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 […]