Akka Dispatcher Issue

82 views
Skip to first unread message

Abhishek G

unread,
May 18, 2017, 3:12:09 AM5/18/17
to Akka User List
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
 

Justin du coeur

unread,
May 18, 2017, 8:47:22 AM5/18/17
to akka...@googlegroups.com
On Thu, May 18, 2017 at 2:58 AM, Abhishek G <abhishek.g...@goesl.co> wrote:
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
                                                         }

I don't think that's where this node belongs in configuration.  Please review the dispatcher docs.
Message has been deleted
Message has been deleted

Abhishek G

unread,
May 19, 2017, 6:45:34 AM5/19/17
to Akka User List
Hi Justin,

Am running this code on local machine. What am missing here...?

Justin du coeur

unread,
May 19, 2017, 9:03:13 AM5/19/17
to akka...@googlegroups.com
No, no -- I mean "node" in the sense that a configuration file is essentially a tree, and each section is a node in that tree.  As far as I know, the description of "my-dispatcher" doesn't belong under ActorSys.akka.actor.  Please re-read the documentation...

On Fri, May 19, 2017 at 2:14 AM, Abhishek G <abhishek.g...@goesl.co> wrote:

Hi Justin,

Am ruuning this code on local machine no concept of node


On Thursday, May 18, 2017 at 12:42:09 PM UTC+5:30, Abhishek G wrote:

--
>>>>>>>>>> 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+unsubscribe@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages