Missing required EnableBinding(Source.class)
authorGustavo Martin Morcuende <gu.martinm@gmail.com>
Sun, 29 Jan 2017 10:43:21 +0000 (11:43 +0100)
committerGustavo Martin Morcuende <gu.martinm@gmail.com>
Sun, 29 Jan 2017 10:43:21 +0000 (11:43 +0100)
SpringJava/Kafka/SpringCloudStream/spring-cloud-stream-kafka-producer-example/src/main/java/de/example/spring/kafka/Application.java
SpringJava/Kafka/SpringCloudStream/spring-cloud-stream-kafka-producer-example/src/main/java/de/example/spring/kafka/Sender.java

index b8306c5..c05ba2f 100644 (file)
@@ -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];
       }
 
index dc14480..9157a7e 100644 (file)
@@ -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;