
Learn how to use the actor model with Akka to build concurrent Java applications. Recap core Java concurrency and explore Akka features through racing game and blockchain mining projects.
Discover how to get support by using the course Q&A, viewing and answering existing questions, asking new ones, contacting the instructor on Udemy, and leaving a review.
Explore how to apply concurrent programming with the Java standard libraries and compare it to the actor model with Akka, using a multi-threaded approach to generate 20 probable primes.
Explore basic concurrent programming in core Java by building a prime generator using runnable tasks, 20 threads, and a shared results set, and compare with the Akka actor model.
Explore common Java concurrency pitfalls, like interrupted exceptions and thread safety, illustrated by a shared primes example, and see how synchronization blocks address data races before Akka's actor model.
Explore the actor model as an alternative to thread-based concurrency, learning how actors and messages enable safe, asynchronous computation. Build intuition with a manager and employee actors generating prime numbers.
Understand what an actor is in the Akka model: an identifiable object with a name and path, a message queue, and a behaviour that processes messages one at a time.
Understand why the actor model achieves thread safety through isolated actors, immutable messages, and single-thread processing via a message queue.
Set up a Maven project for Akka, add akka-actor-typed and logback dependencies, and configure akka-version and testkit to explore the typed API and Akka docs.
Create a first akka actor in java by extending AbstractBehavior<string>, using Behaviours.setup to obtain an ActorContext, and providing a public static create with a private constructor and a createReceive handler.
Create your first actor and define its behaviors by building a simple message handler that responds to any message and prints it to the console using a new receive builder.
Create an Akka ActorSystem, instantiate the first simple behavior, and run the entry-point actor. Send string messages with tell, and observe the actor processing in the console.
Expand the receiveBuilder to handle multiple messages with onMessageEquals and onAnyMessage, creating a chain of behaviors for strings like create a child or say hello.
Create a child actor from a manager using spawn and get context, producing two actors with shared behavior, then exchange who are you messages to reveal their paths.
Explore actor paths in akka by tracing hierarchical URLs like akka://FirstActorSystem/User/James. Learn that path lookup is complex and actor names must be URL-friendly with letters, numbers, dashes, or underscores.
Develop the big primes example by creating a manager and worker actors that respond to a start message by generating a large prime with BigInteger.nextProbablePrime and printing it.
Learn to create a manager behaviour in Akka that spawns twenty worker actors and dispatches a start message to each, then initialize the system from main.
Create a manager behaviour extending abstract behaviour to handle string messages, then spawn 20 worker actors and send them the start message in an Akka actor system.
Create a serializable, immutable worker command message containing the result and a sender reference, enabling the worker to return results to the manager in Akka.
Adjust the worker to accept a custom command type, switch to onAnyMessage for command inspection, and pass a command object with a manager reference in the Akka actor model.
Implement a manager command interface with instruction and result commands to accept start messages and BigInteger results, collect primes in a sorted set, and reply via tell.
Explore Akka's message delivery guarantees: messages are delivered at most once and, when delivered, in order, demonstrated through a single machine manager and worker example.
Convert a simple Java multi-threaded racing game to the actor model (ACA) using two files, ten racer threads, concurrent maps, and a runnable main thread that displays race results.
Architect the race using an akka actor system with a controller and ten racer actors, avoiding thread.sleep, using where are you messages and a timer for periodic updates.
Implement the racer behavior in an akka-based java concurrency case study by defining start and position commands, spawning racer actors, and reporting positions to a race controller.
Use behaviours.withTimers to create a timer that fires every second, sending a GetPositionsCommand to racer actors. Compare startTimerAtFixedRate and startTimerWithFixedDelay, and use a TIMER_KEY to override timers.
Explore how an Akka actor shifts behavior over time by returning different receive handlers, moving from initial to subsequent handlers, and managing state without class-level fields.
Refactor the racer into three message handlers: not yet started, running, and completed; remove class-level position and race length, and transition between handlers as the race progresses.
Build an Akka actor with three message handlers—notYetStarted, running, and completed—while moving race state into messages and handling position and race length transitions.
Shut down actors and the actor system by returning behaviors.stopped after a message, ending the race; a parent shutting down the child avoids dead letters and hints at supervision.
Explore practical Java concurrency with the Akka actor model by stopping child actors, handling racer finished commands, recording finishing times, and gracefully shutting down the race controller and timers.
Learn how akka actor lifecycles stop actors and their children, and how PostStop signal cleans up resources before shutdown. Implement a waitingToStop handler that ignores messages but handles PostStop signals.
Learn to emit custom log messages from actors using the SLF4J logger, configure logging levels, and guard log output with level checks in an Akka actor context.
Configure log level output using logback by adding logback.xml in the resources folder to control console messages at warn, info, and debug levels in a Java Akka project.
This course will cover how to use the Actor Model provided by the Akka framework to build robust, thread-safe concurrent applications with Java.
We'll be leaving behind the traditional problems with multi-threaded programming, such as dealing with non-thread safe variables, deadlocks, thread interruptions and more. Akka gives us a completely different approach. Instead of creating threads, using synchronization, locks, semaphores and countdownlatches, we'll learn how the actor model gives us a very different way to approach concurrent programming.
Learning the actor model from scratch can be a challenge, so in this course we build up the knowlege step by step, meaning you'll have no problems following along and understanding everything we do. And the course is full of practical real-world scenarios, so that you'll be able to take what you learn and apply it to your own projects. Our main case study is that we'll be building a basic blockchain mining application.
Please note that although Akka is built in Scala, absolutely no Scala knowledge is needed for this course. This course covers Akka with Java and we won't be writing any Scala code. It's ideal for Java developers with some experience (although you certainly don't need to be an expert).
This course covers the newer Akka Typed API only.