Using arguments with CommandLineRunner
authorGustavo Martin Morcuende <gu.martinm@gmail.com>
Sun, 19 Feb 2017 22:37:55 +0000 (23:37 +0100)
committerGustavo Martin Morcuende <gu.martinm@gmail.com>
Mon, 20 Feb 2017 06:24:36 +0000 (07:24 +0100)
Example: java -jar -Dtarget/spring-stream-kafka-producer-1.0-SNAPSHOT.jar "HELLO GUS"

SpringJava/Kafka/SpringCloudStream/spring-stream-kafka-producer/src/main/java/de/example/spring/kafka/Application.java

index d513aef..b765a19 100644 (file)
@@ -6,12 +6,18 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.cloud.stream.schema.client.EnableSchemaRegistryClient;
 import org.springframework.context.annotation.Bean;
 
+/**
+ * Using arguments with CommandLineRunner:
+ *
+ * Example: java -jar -Dtarget/spring-stream-kafka-producer-1.0-SNAPSHOT.jar "HELLO GUS"
+ *
+ */
 @SpringBootApplication
 @EnableSchemaRegistryClient
 public class Application {
 
   public static void main(String[] args) {
-    SpringApplication.run(Application.class);
+    SpringApplication.run(Application.class, args);
   }
 
   @Bean