This document describes how to setup:
- The development environment
- The case study project
We recommend using the following tools:
- Eclipse or IntelliJ
- sbt build tool
This course is best suited for individuals that have knowledge of Java. Also, we need access to the internet and a computer with the following software installed:
- Unix compatible shell
- JVM 1.7 or higher
- Scala 2.11 or higher
- Sbt 0.13.8 or higher
If you are running OSX, then you are on a nix system already. Otherwise install a Unix compatible shell like Cygwin.
If you are running OSX and a Homebrew Cask user, from a terminal run:
$ brew cask install java
Otherwise follow the setup instructions to download and install. Once the installation is complete, very the installation by running the following command in a terminal session:
$ java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
If you are running OSX and a Homebrew user, from a terminal run:
$ brew install scala
Otherwise follow the setup instruction to download and install. Once the installation is complete, verify the installation by running the following command in a terminal session:
$ scala -version
Scala code runner version 2.11.6 -- Copyright 2002-2013, LAMP/EPFL
If you are running OSX and a Homebrew user, from a terminal run:
$ brew install sbt
Otherwise follow the setup instruction to download and install. Once the installation is complete, verify the installation by running the following command in a terminal session:
$ sbt -version
sbt launcher 0.13.8
- Read the first chapters of the Getting Started Guide
- Starting
sbt
takes you to a interactive session - Take a look at
build.sbt
and the other.sbt
files for Coffee House - Change directory to the
fast-track-akka-java
directory and startsbt
as follows:
$ sbt
man [e] > coffee-house > initial-state >
The man
command, short for manual, displays the setup instructions (what you are reading now) for the courseware. To view the instructions for the current exercise, use the e
option. If you are using an IDE, you can also open up the setup instructions (README.md
) file or the current exercises instructions (src/test/resources/README.md
) file in your workspace.
// display the setup instructions
man [e] > coffee-house > initial-state > man
// display the instructions for the current exercise
man [e] > coffee-house > initial-state > man e
As part of each exercise, we use the run
command to bootstrap the main class CoffeeHouseApp
. This command starts the application for the current exercise that we interact with and verify our solution.
man [e] > coffee-house > initial-state > run
Koan is the sbt
plugin that allows us to navigate the courseware and pull the current exercises tests that to confirm our solution is accurate. It is important to note that the tests make some assumptions about the code, in particular, naming and scope; please adjust your source accordingly. Following are the available koan
commands:
// show the current exercise
man [e] > coffee-house > initial-state > koan show
[info] Currently at koan 'Initial state (koan:initial)
// move to the next exercise
man [e] > coffee-house > implement-actor > koan next
[info] Moved to next koan 'Implement an actor'
// move to the previous exercise
man [e] > coffee-house > initial-state > koan prev
[info] Moved to previous koan 'Initial state (koan:initial)'
To clean your current exercise, use the clean
command from your sbt
session. Clean deletes all generated files in the target
directory.
man [e] > coffee-house > initial-state > clean
To compile your current exercise, use the compile
command from your sbt
session. This command compiles the source in the src/main/scala
directory.
man [e] > coffee-house > initial-state > compile
To reload sbt
, use the reload
command from your sbt
session. This command reloads the build definitions, build.sbt
, project/.scala
and project/.sbt
files. Reloading is a requirement if you change the build definition files.
man [e] > coffee-house > initial-state > reload
To test your current exercise, use the test
command from your sbt
session. Test compiles and runs all tests for the current exercise. Automated tests are your safeguard and validate whether or not you have completed the exercise successfully and are ready to move on.
man [e] > coffee-house > initial-state > test
Follow these instructions if you want to use Eclipse:
- You can download and install the latest version from Eclipse IDE for your platform
- In Eclipse import the
coffee-house
project
Follow these instructions if you want to use IntelliJ IDEA:
- Download and install the latest version of IntelliJ IDEA 14 for your platform
- In Intellij, import the
coffee-house
project
Welcome to the Akka Coffee House where we work through a series of exercises organized by topic as laid out in the Fast Track to Akka with java slide deck and experience:
- Yummy caffeinated concoctions like
Akkaccino
,MochaPlay
, andCaffeJava
- Guests becoming caffeinated, and waiters can getting frustrated
- Barista's becoming bottlenecks
Our mission is to keep the Akka Coffee House healthy, so make sure you have the deck handy as it is a useful reference for guidance.
- Exercise 0 > Initial State
- Exercise 1 > Implement Actor
- Exercise 2 > Top Level Actor
- Exercise 3 > Message Actor
- Exercise 4 > Use Sender
- Exercise 5 > Child Actors
- Exercise 6 > Actor State
- Exercise 7 > Use Scheduler
- Exercise 8 > Busy Actor
- Exercise 9 > Stop Actor
- Exercise 10 > Lifecycle Monitoring
- Exercise 11 > Faulty Guest
- Exercise 12 > Custom Supervision
- Exercise 13 > Faulty Waiter
- Exercise 14 > Self Healing
- Exercise 15 > Detect Bottleneck
- Exercise 16 > Implement Router
- Exercise 17 > Configure Dispatcher
- Exercise 18 > Modify Behavior
- Exercise 19 > Ask Pattern
- Exercise 20 > Akka Extensions
- Exercise 21 > Fsm