2015-08-22 14:54:43 +03:00
|
|
|
package com.iluwatar.message.channel;
|
|
|
|
|
2015-08-22 15:43:44 +03:00
|
|
|
import org.apache.camel.CamelContext;
|
2015-08-22 16:37:19 +03:00
|
|
|
import org.apache.camel.builder.RouteBuilder;
|
2015-08-22 15:43:44 +03:00
|
|
|
import org.apache.camel.impl.DefaultCamelContext;
|
|
|
|
|
2015-08-22 14:54:43 +03:00
|
|
|
public class App {
|
|
|
|
|
2015-08-22 15:43:44 +03:00
|
|
|
public static void main(String[] args) throws Exception {
|
|
|
|
CamelContext context = new DefaultCamelContext();
|
2015-08-22 16:37:19 +03:00
|
|
|
|
|
|
|
context.addRoutes(new RouteBuilder() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void configure() throws Exception {
|
|
|
|
from("direct:greetings").to("stream:out");
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2015-08-22 15:43:44 +03:00
|
|
|
context.start();
|
2015-08-22 19:07:01 +03:00
|
|
|
context.getRoutes().stream().forEach((r) -> System.out.println(r));
|
2015-08-22 15:43:44 +03:00
|
|
|
context.stop();
|
2015-08-22 14:54:43 +03:00
|
|
|
}
|
|
|
|
}
|