document RemoteRouterConfig, see #1846
- fix Java API - change to pass in Addresses so that validation happens earlier
This commit is contained in:
parent
2d765718cf
commit
ef0af0b47f
7 changed files with 56 additions and 11 deletions
|
|
@ -6,6 +6,7 @@ package akka.docs.routing
|
|||
import akka.routing.RoundRobinRouter
|
||||
import akka.actor.{ ActorRef, Props, Actor, ActorSystem }
|
||||
import akka.routing.DefaultResizer
|
||||
import akka.routing.RemoteRouterConfig
|
||||
|
||||
case class Message1(nbr: Int)
|
||||
|
||||
|
|
@ -40,4 +41,13 @@ object RoutingProgrammaticallyExample extends App {
|
|||
//#programmaticRoutingWithResizer
|
||||
1 to 6 foreach { i ⇒ router3 ! Message1(i) }
|
||||
|
||||
//#remoteRoutees
|
||||
import akka.actor.{ Address, AddressExtractor }
|
||||
val addresses = Seq(
|
||||
Address("akka", "remotesys", "otherhost", 1234),
|
||||
AddressExtractor("akka://othersys@anotherhost:1234"))
|
||||
val routerRemote = system.actorOf(Props[ExampleActor1].withRouter(
|
||||
RemoteRouterConfig(RoundRobinRouter(5), addresses)))
|
||||
//#remoteRoutees
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue