Skip to content

Instantly share code, notes, and snippets.

@jimmidyson
Last active August 29, 2015 14:23
Show Gist options
  • Save jimmidyson/383ca31df030445cc0d3 to your computer and use it in GitHub Desktop.
Save jimmidyson/383ca31df030445cc0d3 to your computer and use it in GitHub Desktop.
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.cdi.ContextName;
@ContextName("myCdiRestCamelContext")
public class MyRoutes extends RouteBuilder {
@Override
public void configure() throws Exception {
restConfiguration().component("netty4-http").host("0.0.0.0").port(8080);
rest("say")
.get("/hello").to("direct:hello")
.get("/bye").consumes("application/json").to("direct:bye")
.post("/bye").to("mock:update");
from("direct:hello")
.transform().constant("Hello World");
from("direct:bye")
.transform().constant("Bye World");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment