Am a newbie to Akka
import akka.actor.Props
import akka.actor.ActorSystem
import akka.actor.Actor
import akka.routing.FromConfig
class RootActor extends Actor{
def receive = {
case msg:String => println(msg+" "+
self.path.name);
var childActor = context.actorOf(Props[Child],"Child");
childActor ! "Hello"
}
}
class Child extends Actor{
def receive = {
case msg:String => println(msg+" "+
self.path.name);
}
}
object AkkaThread{
def main(args:Array[String]){
println("HIIIIIIIIIIIIIII")
var actorSystem = ActorSystem("ActorSys");
var actor = actorSystem.actorOf(Props[RootActor]
.withDispatcher("my-dispatcher") // .withDispatcher(" Actorsys.akka.actor.my-dispatcher") tried along with that facing the same exception
.withRouter(FromConfig()),"RootActor");
actor ! "Hello"
for (n <- 1 until 30) actor !("Hello, Akka #%d!".format(n))
}
}
And My Application.conf file placed at Src/main/resources
ActorSys{
akka{
actor{
provider = "akka.actor.LocalActorRefProvider"
my-dispatcher {
type = "Dispatcher"
executor = "fork-join-executor"
fork-join-executor{
parallelism-min = 50
parallelism-factor = 3.0
parallelism-max = 100
}
throughput = 10
}
}
}
akka.actor.deployment {
"/*/RootActor/*" {
dispatcher = my-dispatcher
router = round-robin-group
routees.paths = ["ActorSys/user/RootActor"]
nr-of-instances = 100
}
}
}
its throwing an error Dispatcher [Actorsys.akka.actor.my-dispatcher] not configured for path akka://Actorsys/user/RootActor. Struck with this
Akka vesion 2.3.16
Thanks