@Override public void configure() throws Exception { from(undertow) // call the sayHello method on the hello bean .bean(hello, "sayHello"); } }
@Override public void configure() throws Exception { // define a Camel REST service using the rest-dsl // where we define a GET /hello as a service that routes to the hello route // we will cover rest-dsl in chapter 10 rest("/").produces("text/plain") .get("hello") .to("direct:hello"); from("direct:hello") .to("geocoder:address:current") .transform().simple("Hello from Spring Boot and Camel. We are at: ${body}"); } }
public static void main(String[] args) throws Exception { CamelContext context = new DefaultCamelContext(); context.addRoutes(new HelloRoute()); context.start(); // keep the JVM running (a bit of a hack) Thread.sleep(Integer.MAX_VALUE); }
public static void main(String[] args) throws Exception { // use org.apache.camel.main.Main to make it easier to run Camel standalone Main main = new Main(); // add the routes main.addRouteBuilder(new HelloRoute()); // run the application (keep it running) main.run(); }
@Override public void configure() throws Exception { from(jetty) // call the sayHello method on the hello bean .bean(hello, "sayHello"); } }
public static void main(String[] args) throws Exception { Main main = new Main(); // bind the bean to the Camel registry using the name hello main.bind("hello", new HelloBean()); // add the route main.addRouteBuilder(new HelloRoute()); // run the application main.run(); } }
@Override public void configure() throws Exception { from("jetty:http://localhost:8080/hello") .transform().simple("Hello from Camel"); } }
@Override public void configure() throws Exception { from("jetty:http://localhost:8080/hello") .transform().simple("Hello from Camel"); } }
@Override public void configure() throws Exception { // trigger the route every 5th second from("timer:foo?period=5s") // call the hello bean say method .beanRef("hello", "say") // log the response from the bean .log("${body}"); } }
@Override public void configure() throws Exception { from(input) // lookup bean with name helloBean .bean("helloBean") .to(output); }