Hello there,
this works as intended and modelled in the Actor Model.
Basically an Actor processes messages one-by-one from its mailbox.
The Actor may be executed on different threads but it will "seem as if" it
is single threaded.


Read also:
http://doc.akka.io/docs/akka/current/general/terminology.html#Concurrency_vs__Parallelism

If you want parallelism you want more Actors.

Or you could use Akka Streams and it's parallel operators.

Hope this helps, welcome to the community;

-- 
Konrad `ktoso` Malawski
Akka <http://akka.io> @ Lightbend <http://lightbend.com>

On 20 February 2017 at 00:53:02, kalyana kannan ([email protected])
wrote:

I am newbie to Akka, Akka not executing parallely with out Routers.

Kindly find my Producer.java & Consumer.java for reference.


*Below code executes jobs one by one*
ActorRef actorRef = system.actorOf(Props.create(Consumer.class));
actorRef .tell(job1..)
actorRef .tell(job2..)
actorRef .tell(job3..)
actorRef .tell(job4..)

*Below code executes jobs parallely, it spans 4 thread*
ActorRef printNumbersConsumer =
system.actorOf(Props.create(Consumer.class).withRouter(new
RoundRobinRouter(4)),"router");
actorRef .tell(job1..)
actorRef .tell(job2..)
actorRef .tell(job3..)
actorRef .tell(job4..)

Kindly correct if my understanding is wrong.
--
>>>>>>>>>> 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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

-- 
>>>>>>>>>>      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 [email protected].
To post to this group, send email to [email protected].
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