From: Gustavo Martin Morcuende Date: Sun, 29 Jan 2017 10:43:21 +0000 (+0100) Subject: Missing required EnableBinding(Source.class) X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=df3d4c6eff1b9aa30f7ca3cc1ac8629185f2657f;p=JavaForFun Missing required EnableBinding(Source.class) --- diff --git a/SpringJava/Kafka/SpringCloudStream/spring-cloud-stream-kafka-producer-example/src/main/java/de/example/spring/kafka/Application.java b/SpringJava/Kafka/SpringCloudStream/spring-cloud-stream-kafka-producer-example/src/main/java/de/example/spring/kafka/Application.java index b8306c5..c05ba2f 100644 --- a/SpringJava/Kafka/SpringCloudStream/spring-cloud-stream-kafka-producer-example/src/main/java/de/example/spring/kafka/Application.java +++ b/SpringJava/Kafka/SpringCloudStream/spring-cloud-stream-kafka-producer-example/src/main/java/de/example/spring/kafka/Application.java @@ -15,12 +15,10 @@ public class Application { @Bean CommandLineRunner lookup(Sender sender) { return args -> { - String topic = "test"; String message = "example message"; if (args.length > 0) { - topic = args[0]; message = args[1]; } diff --git a/SpringJava/Kafka/SpringCloudStream/spring-cloud-stream-kafka-producer-example/src/main/java/de/example/spring/kafka/Sender.java b/SpringJava/Kafka/SpringCloudStream/spring-cloud-stream-kafka-producer-example/src/main/java/de/example/spring/kafka/Sender.java index dc14480..9157a7e 100644 --- a/SpringJava/Kafka/SpringCloudStream/spring-cloud-stream-kafka-producer-example/src/main/java/de/example/spring/kafka/Sender.java +++ b/SpringJava/Kafka/SpringCloudStream/spring-cloud-stream-kafka-producer-example/src/main/java/de/example/spring/kafka/Sender.java @@ -1,15 +1,13 @@ package de.example.spring.kafka; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import javax.inject.Inject; + +import org.springframework.cloud.stream.annotation.EnableBinding; import org.springframework.cloud.stream.messaging.Source; import org.springframework.messaging.support.MessageBuilder; -import javax.inject.Inject; - +@EnableBinding(Source.class) public class Sender { - private static final Logger LOGGER = LoggerFactory.getLogger(Sender.class); - // Aquí podrías haber usado tu custom interface: InputOutputChannels :) private final Source source;