application.conf

An Akka actors ‘remote’ example

While doing some crazy things with SARAH, I realized that the best way to solve a particular problem was to use remote Akka actors. I haven’t had the opportunity to work with Akka much since finishing the Scala Cookbook, so I dug around trying to find a simple Akka remote “Hello, world” example. Unable to find a good one, I read some stuff, and created it myself.

How to read/access Play Framework application.conf properties

Here’s a quick look at how to read Play Framework application.conf configuration properties.

First, given a Play application.conf file with these properties:

foo=42

bar.baz=10

stations = [ 99.5, 102.3, 104.3, 105.9 ]

streams = [
    { "name": "104.3", "file": "104_3.pls" },
    { "name": "WGN",   "file": "wgn.pls" }
]

You can read the foo property (as a String) from your Play code like this: