From 629309e2114e7f7ae4293b7c5b4b855556fd1f5c Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Sun, 19 Feb 2017 23:37:55 +0100 Subject: [PATCH] Using arguments with CommandLineRunner Example: java -jar -Dtarget/spring-stream-kafka-producer-1.0-SNAPSHOT.jar "HELLO GUS" --- .../src/main/java/de/example/spring/kafka/Application.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/SpringJava/Kafka/SpringCloudStream/spring-stream-kafka-producer/src/main/java/de/example/spring/kafka/Application.java b/SpringJava/Kafka/SpringCloudStream/spring-stream-kafka-producer/src/main/java/de/example/spring/kafka/Application.java index d513aef..b765a19 100644 --- a/SpringJava/Kafka/SpringCloudStream/spring-stream-kafka-producer/src/main/java/de/example/spring/kafka/Application.java +++ b/SpringJava/Kafka/SpringCloudStream/spring-stream-kafka-producer/src/main/java/de/example/spring/kafka/Application.java @@ -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 -- 2.1.4