Excellent answer Adam.

An interesting point to add here is that when using Scala there is no need
to call unhandled() explicitly, because Scala’s PartialFunction allows us
to inspect if the function is able to handle a message or not. If not (no case
x => matches the message), we call unhandled() right away.
In case of Java calling unhandled must be performed manually - for reasons
Adam explained.

The setting to log debug messages when unhandled messages appear is:
akka.actor.debug.unhandled btw.
​

On Sun, Apr 26, 2015 at 8:17 AM, Adam <adamho...@gmail.com> wrote:

> Unhandled is mainly useful for troubleshooting. Akka won't check if you
> actually did something with the message or not. It also doesn't force you
> to call unhandled and probably (never tried this) does't prevent you from
> calling unhandled multiple times. The documentation goes into detail
> regarding what exactly happens when you call unhandled.
>
> Akka likewise has no "black magic" that checks your logic (e.g. through
> byte code injection). If you've failed to call become or do anything else
> you should have done, the you have a bug and Akka provides the tools to
> help you track it down. For example, calls to unhandled can be translated
> to debug messages via configuration.
>
> --
> >>>>>>>>>>      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+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Cheers,
Konrad 'ktoso' Malawski
Akka <http://akka.io/> @ Typesafe <http://typesafe.com/>

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

Reply via email to