Search in sources :

Example 1 with RoundRobinPool

use of akka.routing.RoundRobinPool in project newrelic-java-agent by newrelic.

the class TestApp method sendRoutedMessageToRouteeInTransaction.

@Trace(dispatcher = true)
public static void sendRoutedMessageToRouteeInTransaction(ActorSystem system) throws InterruptedException {
    final ActorRef routee = system.actorOf(Props.create(Routee.class));
    ActorRef router = system.actorOf(new RoundRobinPool(5).props(Props.create(RoutingActor.class, routee)));
    // Let system initialize
    Thread.sleep(2000);
    router.tell("routing", null);
    // Let message processing finish
    Thread.sleep(2000);
}
Also used : ActorRef(akka.actor.ActorRef) RoundRobinPool(akka.routing.RoundRobinPool) Routee(com.nr.instrumentation.akka22.test.actors.routing.Routee) Trace(com.newrelic.api.agent.Trace)

Example 2 with RoundRobinPool

use of akka.routing.RoundRobinPool in project newrelic-java-agent by newrelic.

the class TestApp method sendRoutedMessageInTransaction.

@Trace(dispatcher = true)
public static void sendRoutedMessageInTransaction(ActorSystem system) throws InterruptedException {
    ActorRef router = system.actorOf(new RoundRobinPool(5).props(Props.create(RoutingActor.class)));
    // Let system initialize
    Thread.sleep(2000);
    router.tell("routing", null);
    // Let message processing finish
    Thread.sleep(2000);
}
Also used : ActorRef(akka.actor.ActorRef) RoundRobinPool(akka.routing.RoundRobinPool) Trace(com.newrelic.api.agent.Trace)

Aggregations

ActorRef (akka.actor.ActorRef)2 RoundRobinPool (akka.routing.RoundRobinPool)2 Trace (com.newrelic.api.agent.Trace)2 Routee (com.nr.instrumentation.akka22.test.actors.routing.Routee)1