Camel examples for spring-boot-cli (#79)
diff --git a/spring-boot-cli/hello.groovy b/spring-boot-cli/hello.groovy
new file mode 100644
index 0000000..64831e3
--- /dev/null
+++ b/spring-boot-cli/hello.groovy
@@ -0,0 +1,30 @@
+@Grab("org.apache.camel:camel-core:3.18.0")
+
+import org.apache.camel.builder.RouteBuilder;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.impl.DefaultCamelContext;
+
+class CamelRunner {
+
+ RouteBuilder hello() {
+ return new RouteBuilder() {
+ public void configure() {
+ from("timer:simple?period=1000")
+ .log("Hello Cameleers")
+ }
+ }
+
+ }
+
+ @Bean
+ public CommandLineRunner runner() {
+ return (args) -> {
+ try (CamelContext camelContext = new DefaultCamelContext()) {
+ camelContext.addRoutes(hello());
+ camelContext.start();
+ Thread.sleep(10000);
+ }
+ };
+ }
+}
\ No newline at end of file
diff --git a/spring-boot-cli/readme.md b/spring-boot-cli/readme.md
new file mode 100644
index 0000000..0def4ae
--- /dev/null
+++ b/spring-boot-cli/readme.md
@@ -0,0 +1,14 @@
+Camel examples for running routes using Spring Boot CLI
+
+### Instructions
+
+[Installation](https://docs.spring.io/spring-boot/docs/current/reference/html/getting-started.html#getting-started.installing.cli)
+
+[Running Application](https://docs.spring.io/spring-boot/docs/current/reference/html/cli.html#cli.using-the-cli.run)
+
+
+### Quickstart
+
+` sdk install springboot`
+
+`spring run hello.groovy`
\ No newline at end of file