Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
akka.actor.deployment {
  /router1 {
    router = round-robin-pool
    nr-of-instances = 5
  }

  /router2 {
    router = random-pool
    nr-of-instances = 5
  }

  /router3 {
    router = balancing-pool
    nr-of-instances = 5
    pool-dispatcher {
      attempt-teamwork = off
    }
  }

  /router4 {
    router = balancing-pool
    nr-of-instances = 5
    pool-dispatcher {
      executor = "thread-pool-executor"

      # allocateThread exactlyPool을 5 threads for this pool지정할수도 있습니다.
      thread-pool-executor {
        core-pool-size-min = 5
        core-pool-size-max = 5
      }
    }
  }

  /router5 {
    router = smallest-mailbox-pool
    nr-of-instances = 5
  }}

...

라우터 생성코드

Code Block
                ActorRef router =
                        actorSystem.actorOf(FromConfig.getInstance()
.props(WorkerActor.Props(probe.getRef())), routerName);


@Test
public void RoundRobinRoutingTest(){
RouterByNameTest("router1");
}

@Test
public void RandomRoutingTest(){
RouterByNameTest("router2");
}

@Test
public void BalancingRoutingTest(){
RouterByNameTest("router3");
}

라우팅을 코드로 정의할수 있지만 설정화로 완전하게 분리할수있습니다. 라우팅 생성은 정의된 


테스트 결과

...

해당 테스트 시나리오에서 아래와 같은 테스트 결과가 나왔으며~ BalancingRouting 이 전체 처리가 가장 빨랐습니다.

...