1 package de.example.spring.kafka;
3 import org.slf4j.Logger;
4 import org.slf4j.LoggerFactory;
5 import org.springframework.cloud.stream.messaging.Source;
6 import org.springframework.messaging.support.MessageBuilder;
8 import javax.inject.Inject;
11 private static final Logger LOGGER = LoggerFactory.getLogger(Sender.class);
13 // Aquí podrías haber usado tu custom interface: InputOutputChannels :)
14 private final Source source;
17 public Sender(Source source) {
21 public void sendMessage(String message) {
22 source.output().send(MessageBuilder.withPayload(message).build());