CAMEL-19404: Add @Value in example
diff --git a/jbang/dependency-injection/Echo.java b/jbang/dependency-injection/Echo.java
index 22eb915..0d79569 100755
--- a/jbang/dependency-injection/Echo.java
+++ b/jbang/dependency-injection/Echo.java
@@ -1,6 +1,7 @@
// camel-k: language=java
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
@@ -12,13 +13,16 @@
@Autowired
private org.apache.camel.CamelContext context;
+ @Value("greeting")
+ private String prefix;
+
@Bean
public CamelLogger myLogger() {
return new CamelLogger("myLogger");
}
public String echo(String echo) {
- return echo + echo + "!! from " + context.getName();
+ return prefix + " " + echo + echo + "!! from " + context.getName();
}
diff --git a/jbang/dependency-injection/application.properties b/jbang/dependency-injection/application.properties
new file mode 100644
index 0000000..8130d23
--- /dev/null
+++ b/jbang/dependency-injection/application.properties
@@ -0,0 +1 @@
+greeting = Howdy
\ No newline at end of file