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 // You could use here your custom interface. See: InputOutputChannels :)
12 private final Source source;
15 public Sender(Source source) {
19 public void sendMessage(String message) {
20 Product product = new Product(message, "this is some description");
21 source.output().send(MessageBuilder.withPayload(product).build());