1 package de.example.spring.kafka;
3 import javax.inject.Inject;
5 import org.springframework.cloud.stream.annotation.EnableBinding;
6 import org.springframework.cloud.stream.messaging.Source;
7 import org.springframework.messaging.support.MessageBuilder;
9 @EnableBinding(Source.class)
11 // Aquí podrías haber usado tu custom interface: InputOutputChannels :)
12 private final Source source;
15 public Sender(Source source) {
19 public void sendMessage(String message) {
20 source.output().send(MessageBuilder.withPayload(message).build());