Skip to content

Instantly share code, notes, and snippets.

@mranest
Last active July 22, 2016 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mranest/6ce4051e454eb009ce7ada1dbfa76431 to your computer and use it in GitHub Desktop.
Save mranest/6ce4051e454eb009ce7ada1dbfa76431 to your computer and use it in GitHub Desktop.
Spring Boot CLI groovy script with Camel support
@Grab("org.apache.camel:camel-spring-boot:2.17.2")
@GrabExclude("org.apache.camel:camel-groovy:2.17.2")
import org.apache.camel.builder.RouteBuilder
import org.apache.camel.spring.boot.CamelSpringBootApplicationController
class CamelRunner implements CommandLineRunner {
@Bean
def files() { new RouteBuilder() { void configure() {
from("direct:test")
.routeId("test")
.to("log:test")
}}}
@Autowired
CamelSpringBootApplicationController applicationController
void run(String... args) { applicationController.blockMainThread() }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment