try
{
log.info("{} - Subscribing to topic test", id);
- consumer.subscribe(Arrays.asList("test"));
+ // TODO: subscribe!
running = true;
while (true)
{
- ConsumerRecords<String, String> records =
- consumer.poll(Duration.ofSeconds(1));
-
- log.info("{} - Received {} messages", id, records.count());
- for (ConsumerRecord<String, String> record : records)
- {
- consumed++;
- log.info(
- "{} - {}: {}/{} - {}={}",
- id,
- record.offset(),
- record.topic(),
- record.partition(),
- record.key(),
- record.value()
- );
- }
+ // TODO:
+ // * Poll for new records
+ // * Loop through received records
+ // * Count received records in the variable `consumed`
+ // * "Work" with the data: Log partition/offset/key/value
}
}
catch(WakeupException e)