pekko/akka-docs/rst/java/code/docs/camel/sample/route/CustomRouteSample.java

24 lines
845 B
Java
Raw Normal View History

2012-07-15 14:12:03 +02:00
package docs.camel.sample.route;
import akka.actor.*;
import akka.camel.CamelExtension;
public class CustomRouteSample {
@SuppressWarnings("unused")
2012-07-15 14:12:03 +02:00
public static void main(String[] args) {
try {
//#CustomRouteExample
// 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");
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();
}
}
}