Messaging model

The basic premise of an Actor Model is communication via messages. Actor state responds or reacts based on the message that is passed on to the actor. All messages passed should be immutable. In case you pass mutable messages to the actors, the application might behave in weird ways because of the shared mutable message.

Messaging model

Sending messages

Once the actor reference is available, messages can be passed to an actor in two modes, as follows:

  • Fire and forget: This is a one-way message model, where the producer of the message expects no reply from the consumer. The message is sent asynchronously and the method returns immediately. Akka actors ...

Get Akka Essentials now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.