From df3d4c6eff1b9aa30f7ca3cc1ac8629185f2657f Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Sun, 29 Jan 2017 11:43:21 +0100 Subject: [PATCH] Missing required EnableBinding(Source.class) --- .../src/main/java/de/example/spring/kafka/Application.java | 2 -- .../src/main/java/de/example/spring/kafka/Sender.java | 10 ++++------ 2 files changed, 4 insertions(+), 8 deletions(-) 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; -- 2.1.4