To explain my issue in a clear way I provided a sample code:

if I have an actor which looks like this:

class MasterActor extends Actor with ActorLogging with WorkerRouter with 
AkkaProvider { 
    
  private val router = createWorkerRouter()


  def receive = {
     case PurchaseOrderMsg(content,timestamp) =>
       router ! Response(timestamp)


trait WorkerRouter {this: Actor =>
 def createWorkerRouter(): ActorRef = {
    val resizer = DefaultResizer(lowerBound = 2, upperBound = 15)
    context.actorOf(
        ClusterRouterPool(RoundRobinPool(7,Some(resizer)),
                           ClusterRouterPoolSettings(
                                  totalInstances = Int.MaxValue,
                                  maxInstancesPerNode = 10,
                                  allowLocalRoutees = false,
                                  useRole = Some("worker"))
                           ).props(Worker.props(???),
                           name = "purchase-order-router")
     }
}





How do I pass dynamically props to createWorkerRouter from my MasterActor?

I use the props from the Worker as persistence_id since it's a FSM therefore it 
has to be unique.

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to