Package akka.camel

Examples of akka.camel.Camel


public class CustomRouteTestBase {
  public void customRoute() throws Exception{
    //#CustomRoute
    ActorSystem system = ActorSystem.create("some-system");
    Camel camel = CamelExtension.get(system);
    ActorRef responder = system.actorOf(Props.create(Responder.class), "TestResponder");
    camel.context().addRoutes(new CustomRouteBuilder(responder));
    //#CustomRoute
    system.stop(responder);
    JavaTestKit.shutdownActorSystem(system);
  }
View Full Code Here


import akka.camel.CamelExtension;
import org.apache.camel.ProducerTemplate;

public class RequestBodyActor extends UntypedActor {
  public void onReceive(Object message) {
    Camel camel = CamelExtension.get(getContext().system());
    ProducerTemplate template = camel.template();
    getSender().tell(template.requestBody("direct:news", message), getSelf());
  }
View Full Code Here

import akka.camel.CamelExtension;
import org.apache.camel.ProducerTemplate;

public class MyActor extends UntypedActor {
  public void onReceive(Object message) {
    Camel camel = CamelExtension.get(getContext().system());
    ProducerTemplate template = camel.template();
    template.sendBody("direct:news", message);
  }
View Full Code Here

    // ..
    ActorSystem system = ActorSystem.create("some-system");
    Props props = Props.create(MyConsumer.class);
    ActorRef producer = system.actorOf(props,"myproducer");
    Camel camel = CamelExtension.get(system);
    // get a future reference to the activation of the endpoint of the Consumer Actor
    Timeout timeout = new Timeout(Duration.create(10, SECONDS));
    Future<ActorRef> activationFuture = camel.activationFutureFor(producer,
      timeout, system.dispatcher());
    //#CamelActivation
    //#CamelDeactivation
    // ..
    system.stop(producer);
    // get a future reference to the deactivation of the endpoint of the Consumer Actor
    Future<ActorRef> deactivationFuture = camel.deactivationFutureFor(producer,
      timeout, system.dispatcher());
    //#CamelDeactivation
    JavaTestKit.shutdownActorSystem(system);
  }
View Full Code Here

public class CamelExtensionTest {
  @Test
  public void getCamelExtension() {
    //#CamelExtension
    ActorSystem system = ActorSystem.create("some-system");
    Camel camel = CamelExtension.get(system);
    CamelContext camelContext = camel.context();
    ProducerTemplate producerTemplate = camel.template();
    //#CamelExtension
    JavaTestKit.shutdownActorSystem(system);
  }
View Full Code Here

    JavaTestKit.shutdownActorSystem(system);
  }
  public void addActiveMQComponent() {
    //#CamelExtensionAddComponent
    ActorSystem system = ActorSystem.create("some-system");
    Camel camel = CamelExtension.get(system);
    CamelContext camelContext = camel.context();
    // camelContext.addComponent("activemq", ActiveMQComponent.activeMQComponent(
    //   "vm://localhost?broker.persistent=false"));
    //#CamelExtensionAddComponent
      JavaTestKit.shutdownActorSystem(system);
  }
View Full Code Here

TOP

Related Classes of akka.camel.Camel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.