Consumer.poll() returns empty ConsumerRecords

@aupres This is the expected behavior of the Consumer API poll function. The consumer polls for new records, and the return value is null if there are no new records to consume. You are passing the poll function a timeout of 0, which means the consumer is running in a very tight loop. All you see in the output is a stream of “It is Empty!!”, however, I tested the code and it does consume the records from the producer, you just can’t see them as the terminal is flooded with the “empty case”. Comment out the records.isEmpty case, and give your consumer a unique group.id value and you will see the records on the console. I would suggest you add a non-zero value to the poll function timeout so that you consumer is not spinning on the empty case instead it waits a bit for records to arrive before iterating on the loop.

Hope this helps.