2012-07-15 14:12:03 +02:00
|
|
|
package docs.camel.sample.route;
|
|
|
|
|
|
|
|
|
|
import akka.actor.*;
|
|
|
|
|
import akka.camel.CamelExtension;
|
|
|
|
|
|
|
|
|
|
public class CustomRouteSample {
|
2013-04-14 22:56:41 +02:00
|
|
|
@SuppressWarnings("unused")
|
2012-07-15 14:12:03 +02:00
|
|
|
public static void main(String[] args) {
|
|
|
|
|
try {
|
|
|
|
|
//#CustomRouteExample
|
2012-10-01 20:35:19 +02:00
|
|
|
// the below lines can be added to a Boot class, so that you can run the
|
|
|
|
|
// example from a MicroKernel
|
2012-07-15 14:12:03 +02:00
|
|
|
ActorSystem system = ActorSystem.create("some-system");
|
2013-04-14 22:56:41 +02:00
|
|
|
final ActorRef producer = system.actorOf(Props.create(Producer1.class));
|
|
|
|
|
final ActorRef mediator = system.actorOf(Props.create(Transformer.class, producer));
|
|
|
|
|
final ActorRef consumer = system.actorOf(Props.create(Consumer3.class, mediator));
|
2012-07-15 14:12:03 +02:00
|
|
|
CamelExtension.get(system).context().addRoutes(new CustomRouteBuilder());
|
|
|
|
|
//#CustomRouteExample
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|