Code for https://groups.google.com/forum/#!topic/akka-user/IKWCjXMpV4A