83f36605316273fc080eadbc7b233b5a1cf890af
[JavaForFun] /
1 package de.example.spring.kafka;
2
3 import org.slf4j.Logger;
4 import org.slf4j.LoggerFactory;
5 import org.springframework.cloud.stream.annotation.EnableBinding;
6 import org.springframework.cloud.stream.annotation.StreamListener;
7 import org.springframework.cloud.stream.messaging.Sink;
8
9 @EnableBinding(Sink.class)
10 public class Receiver {
11   private static final Logger LOGGER = LoggerFactory.getLogger(Receiver.class);
12
13   @StreamListener(Sink.INPUT)
14   public void handle(String message) {
15     LOGGER.info("received message='{}'", message);
16   }
17
18 }