A routee is an actor a router can choose as the destination for a message. Routees let independent work run in parallel: a camera can distribute photo batches among photo processors, while other routers can choose destinations from message content or router state. section 6.2 section 6.3
A routing strategy selects the routee. Round-robin gives each routee a turn; random selects one randomly; consistent hashing deterministically selects one from a message and remains useful as routees change; broadcasting sends qualifying messages to every matching routee. section 6.3 section 6.5
Table 6.1 Router logic options (view table figure)
Compare the built-in strategies by how they select one routee or fan a message out to several routees. section 6.3
Routee ownership distinguishes the two built-in router forms. A pool router creates and manages its routees, making it suitable when they exist only inside the router’s domain. A group router discovers routees created elsewhere through the receptionist and a service key, allowing their lifecycle and placement to remain under external control. section 6.3 section 6.3.1 section 6.3.3
See why pool routees are children of their router, whereas group routees may belong to other actors. section 6.3
Pool routees for simple parallel work
Define a pool size and routee behavior, then spawn the resulting router as an ActorRef and send it messages. The router forwards each message according to its strategy; a pool uses round-robin unless configured otherwise. Give routees a restart strategy: a failed routee stops by default, reducing capacity, and a message can reach deadLetters during the interval before the router learns that a child stopped. section 6.3.1 section 6.3.2
Group routees discovered for photo processing
Register independently created photo processors under a ServiceKey, then create a group router with that key. The router cannot deliver a photo URL until at least one processor is registered. Choosing round-robin gives registered processors a fair share of incoming photos. section 6.3.3 section 6.5
Choose a pool when the router should own simple workers. Choose a group when workers must be created, located, or supervised elsewhere. For exceptional messages, use a broadcast predicate so only messages meeting the condition reach every routee, such as a serious highway violation sent to all patrol officers. section 6.3.1 section 6.3.2 section 6.3.3
