Chapter 2. Getting started with Akka

 

This chapter covers

  • Building an actor system
  • Distributing and scaling horizontally
  • Applying reactive principles

You understand from chapter 1 the tenets of reactive design, but haven’t yet seen them in practice. This chapter changes that situation. In this chapter, you build a simple reactive system by using the actor model that was introduced in chapter 1. The actor model is one of the most common reactive patterns. Actors can send and receive messages, make local decisions, create new actors, and do all that asynchronously and without locks. You build the example in this chapter with the Akka toolkit, which you also saw previously. Akka is a powerful system for creating and running actors. It’s written in the Scala language, and the examples in this chapter are also written in Scala. Chapters 3 and 4 explain Akka in more depth.

The system you build consists of two actors passing messages to each other; you can use the same skills to create much larger applications. Next, you’ll learn to scale the system horizontally by adding more copies of one of the actors. Finally, you’ll see how this approach produces a system that’s both message-driven and elastic—two of the four reactive properties from the Reactive Manifesto.

2.1. Understanding messages and actors

 
 

2.2. Setting up the example project

 
 

2.3. Starting the actor system

 
 
 

2.4. Distributing the actors over multiple systems

 
 
 

2.5. Scaling with multiple actors

 
 

2.6. Creating a pool of actors

 
 

2.7. Scaling with multiple-actor systems

 
 
 

2.8. Applying reactive principles

 
 

Summary

 
 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest