Let’s create the most well known application for us, the HELLO WORLD APP
In order to have the required actor of an AKKA application, we will need:
A message
An actor
A message
This is quite simple, we only need one line of code:
An actor
Don’t be afraid, this is quite simple too. You just have to inherit from akka.actor.Actor and provide an implementation for the receive method.
This method will be executed when the actor receives the message.
For finish, we only need to send the message to the Actor. Let’s say that someone has sent me a message to work on the Hello World app, the app should looks like:
I love Scala because it help us to keep the things really simple, the whole application can reside in just one file:
The code is available on Github, if you want to run it just type: