I am using Kafka queue to hold some objects that is to be retreived by consumer app and perform some operation on it.
Problem : If the processing by consumer takes more than ~2 hrs kafka seems to give back the same object again and again
Code :
private static Queue queue = new LinkedList();
while (true) {
ConsumerRecords<String, String> records = consumer.poll(Long.MAX_VALUE);
for (ConsumerRecord<String, String> record : records) {
System.out.println("\n\n\n Kafka has :[" + record.offset());
queue.add(record.value());
}
System.out.println("\n\n\n Kafka has :[" + records.count());
if (queue != null) {
maintainQueue();
}
}