Created
April 25, 2010 14:32
-
-
Save marcelmaatkamp/378443 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env groovy | |
import org.apache.camel.* | |
@Grapes([ | |
@Grab('org.springframework:spring:2.5.6'), | |
@Grab('org.apache.camel:camel-core:2.2.0'), | |
@GrabConfig(systemClassLoader = true) | |
]) | |
// define route | |
class MyRouteBuilder extends org.apache.camel.builder.RouteBuilder { | |
void configure() { | |
from("direct://foo").to("mock://result") | |
} | |
} | |
def mrb = new MyRouteBuilder() | |
def ctx = new org.apache.camel.impl.DefaultCamelContext() | |
ctx.addRoutes mrb | |
ctx.start() | |
def p = ctx.createProducerTemplate() | |
p.sendBody "direct:foo", "Camel Ride for beginner" | |
def e = ctx.getEndpoint("mock://result") | |
def ex = e.exchanges.first() | |
println "INFO> ${ex}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment