Created
December 15, 2020 10:23
-
-
Save mchmielarz/d3150a8a9fbec795cf758ad32a15bec4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@KafkaListener(groupId = "micronaut-group", clientId = "${kafka.consumers.micronaut-group.client-id}", batch = true) | |
public class BatchedMicronautListener { | |
@Topic("${kafka.consumers.micronaut-group.topic}") | |
void receive(List<ConsumerRecord<String, String>> records) { | |
log.info("Batch received: {}", records.size()); | |
records.forEach(rec -> | |
// processing logic comes here | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment