ConsumerRecords<String, String> records = kafkaConsumer.poll(1000);
pollMessages(records);
private void pollMessages(ConsumerRecords<String, String>records) throws Exception {
//AppDynamics instrumentation gets applied here
for (ConsumerRecord<String, String> record : records) {
//Processing of the records
System.out.println(record.value());
}
}