Kafka - with Java/Python
You want to process messages from a Kafka topic and filter out any messages with empty values before printing. Which code snippet correctly implements this using the Java consumer client?
consumer.subscribe(Collections.singletonList("my-topic"));
ConsumerRecords<String, String> records = consumer.poll(Duration.ofMillis(1000));
for (ConsumerRecord<String, String> record : records) {
// What to add here?
}