Akka (6) — Mailbox

haimei
play-hard-work-hard
1 min readApr 21, 2016

An Akka Mailbox holds the messages that are destined for an Actor. Normally each Actor has its own mailbox, but with for example a BalancingPool all routes will share a single mailbox instance.

When the mailbox is not specified as the default mailbox is used. By default it is an unbounded mailbox, which is backed by a java.util.concurrent.ConcurrentLinkedQueue.

Using bounded mailbox:

  • When mailbox is full, messages go to DeadLetters.
  • mailbox-push-timeout-time: how long to wait when mailbox is full
  • Doesn’t work for distributed Akka systems.

--

--