Hi All I have sent messages to Kafka for one minute. I found 97446 messages in producer side and 96896 messages in consumer side for Case 1. I also tried case 2. I have faced the same issues. The number is not match between producer and consumer. Can someone take a look at this issue? Thanks.
Case 1: long startTime = System.currentTimeMillis(); long maxDurationInMilliseconds = 1 * 60 * 1000; int messageNo = 0; while (true) { if (System.currentTimeMillis() <= startTime + maxDurationInMilliseconds) { messageNo++; String messageStr = "KAFKA_"+messageNo; System.out.println("Message: "+messageNo); producer.send(new KeyedMessage<Integer, String>(topic,messageStr)); } else { producer.close(); System.out.println("Total kafka Message: "+messageNo); break; } } Case 2: for (int i=1;i<=12000;i++) String messageStr = "KAFKA_"+i; producer.send(new KeyedMessage<Integer, String>(topic,messageStr)); Best regards Hawin