1 package de.example.spring.kafka;
3 import org.slf4j.Logger;
4 import org.slf4j.LoggerFactory;
5 import org.springframework.kafka.annotation.KafkaListener;
7 import java.util.concurrent.CountDownLatch;
9 public class Receiver {
11 private static final Logger LOGGER = LoggerFactory.getLogger(Receiver.class);
13 private CountDownLatch latch = new CountDownLatch(1);
15 @KafkaListener(topics = "example.topic")
16 public void receiveMessage(String message) {
17 LOGGER.info("received message='{}'", message);
21 public CountDownLatch getLatch() {