Reactive Applications with Akka.NET
Anthony Brown
  • MEAP began January 2016
  • Publication in November 2017 (estimated)
  • ISBN 9781617292989
  • 350 pages (estimated)
  • printed in black & white

Developing applications in a reactive style ensures that the experience is always responsive. Akka.NET is a framework for building distributed, message-driven applications which are able to stay responsive for the user even in the face of failure or when faced with more users. It makes it easy for .NET developers to write applications which are able to react to changes in their environment.

"This book gives a good solid introduction to Akka.NET."

~ Nick McGinness

"Essential reference to using Akka.NET."

~ Jeff Smith

"An excellent in depth and practical book which should be read by anyone who is interested in developing and designing next generation concurrent applications."

~ Dror Helper

Table of Contents detailed table of contents

Part 1: The road to reactive

1. Why Reactive?

1.1. Why the need for reactive systems

1.1.1. Requirements for users

1.1.2. Requirements for businesses

1.2. The reactive methodology

1.3. The routes to reactive

1.3.1. Akka.Net— Actor based concurrency

1.3.2. Reactive Extensions — Event based concurrency

1.4. What this book will teach you

1.5. Summary

2. Reactive Application Design

2.1. Designing an Application with Reactive traits

2.1.1. Representing entities in our reactive system

2.1.2. The flow of data

2.1.3. Processing complex tasks

2.1.4. Reading data

2.1.5. The application so far

2.2. Handling failure

2.2.1. Sensors break

2.2.2. Sensor data connection fails

2.2.3. Data ingestion node fails

2.2.4. A sensor actor fails

2.2.5. A room actor fails

2.2.6. View fails

2.2.7. Failure recovery summary

2.3. Summary

Part 2: Digging in

3. Your First Akka.Net Application

3.1. Setting up an application

3.2. Actors

3.2.1. What does an actor embody?

3.2.2. What can an actor do?

3.2.3. Defining an actor

3.2.4. Summary

3.3. Spawning an actor

3.3.1. The actor system

3.3.2. Spawning an actor

3.3.3. Summary

3.4. Communicating with actors

3.4.1. Actor addresses and references

3.4.2. Sending a message

3.4.3. Summary

3.5. Summary

4. State, behavior and actors

4.1. Preparing for the next message

4.2. Setting appropriate receive behaviour in Akka.Net

4.2.1. Switchable behaviours

4.2.2. Become and Unbecome

4.2.3. Switchable behaviour summary

4.3. Finite State Machines

4.3.1. Understanding Finite State Machines

4.3.2. The use in a concurrency model

4.3.3. Converting a finite state machine to an actor

4.3.4. Using the Finite State Machine actor

4.3.5. Finite state machines summary

4.4. Summary

5. Configuration, Dependency Injection and Logging

5.1. Why do we need configuration?

5.2. Configuring an actor deployment

5.2.1. Understanding Props

5.2.2. Actor configuration summary

5.3. Dependency Injection

5.3.1. Introducing dependency injection[2]

5.3.2. Configuring an Inversion of Control container

5.3.3. Dependency injection summary

5.4. Hocon — A human readable configuration file format

5.4.1. What is HOCON?

5.4.2. Loading configuration into an actor system

5.4.3. HOCON Summary

5.5. Logging

5.5.1. Why do we need logging?

5.5.2. Writing to the log

5.5.3. Customising a logger deployment

5.5.4. Logging summary

5.6. Configuration, Dependency Injection and Logging Summary

6. Failure Handling

6.1. Understanding failures

6.2. Handling application level failures

6.2.1. Responding to application errors

6.2.2. The Akka.Net supervision tree

6.2.3. Failing fast

6.2.4. The actor lifecycle

6.2.5. Watching for the deaths of other actors

6.2.6. Interface level failures

6.2.7. Application level failures summary

6.3. Understanding transport level failures

6.3.1. Writing applications which handle message loss

6.3.2. Transport level failure summary

6.4. Handling failures summary

7. Scaling in reactive systems

7.1. Scaling up and scaling out

7.2. Distributing work

7.2.1. Routers

7.2.2. Pools and groups

7.2.3. Distributing work summary

7.3. Routing strategies within Akka.Net

7.3.1. Random routing

7.3.2. Round robin routing

7.3.3. Shortest mailbox queue

7.3.4. Consistent hashing

7.3.5. Scatter gather first completed

7.3.6. Tail chopping router

7.3.7. Routing strategies summary

7.4. Scaling reactive systems summary

8. Composing actor systems

8.1. Introducing Akka.Net Remoting

8.2. Preparing to use remoting

8.3. Communicating with remote actors

8.3.1. Remote actor system addresses

8.3.2. Sending messages to remote actors

8.3.3. Remote deployment of actors

8.3.4. Remote actor communication summary

8.4. Elastic scale across machines

8.4.1. Configuring a router to use multiple machines

8.5. Failure handling across machines

8.5.1. Supervisor strategies across a network

8.5.2. Remoting deathwatch

8.5.3. Failure handling across machines summary

8.6. Akka.Remote security

8.6.1. Limiting messages able to be sent over the network

8.6.2. Restricting available remote actor targets

8.6.3. Akka.Remote security summary

8.7. Composing actor systems summary

Part 3: Real-life usage

9. Testing Akka.Net actors

9.1. Introducing Akka.TestKit

9.2. Unit testing actors

9.2.1. Spawning test actors

9.2.2. Validating internal data

9.2.3. Testing FSMs

9.2.4. Unit Testing Actors summary

9.3. Integration testing actors

9.3.1. Creating test specifications

9.3.2. Asserting message responses

9.3.3. Time based testing

9.3.4. Test probes

9.3.5. Integration testing actors summary

9.4. Testing distributed applications with the MultiNodeTestKit

9.4.1. Multinode specs

9.4.2. Running code on individual actor systems

9.4.3. Barriers

9.4.4. Testing for network failure

9.4.5. Multinodetestkit summary

9.5. Akka.TestKit Summary

10. Integrating Akka.Net

10.1. Integrating with ASP.Net

10.2. Integrating with SignalR

10.2.1. Communicating through an actor

10.2.2. Connecting to the user's web browser

10.2.3. Integrating with SignalR summary

10.3. Custom integrations with Akka.IO

10.3.1. Creating a listen server

10.3.2. Sending data through Akka.IO

10.3.3. Akka.IO Summary

10.4. Integrating Akka.Net summary

11. Storing actor state with Akka.Persistence

11.1. Understanding Event sourcing

11.2. Using Akka.Persistence

11.2.1. Writing Persistent Actors

11.2.2. Configuring a journal

11.2.3. Using Akka.Persistence summary

11.3. Akka.Persistence performance tuning

11.3.1. Snapshot stores

11.3.2. Async write journals

11.4. Akka.Persistence performance tuning

11.5. At least once delivery

11.6. Upgrade strategies for applications using event sourcing

11.7. Chapter Summary

12. Building clustered applications with Akka.Cluster

12.1. Introducing Akka.Cluster

12.2. Cluster aware routers

12.2.1. Creating cluster aware router groups

12.2.2. Creating cluster aware router pools

12.2.3. Cluster aware routers summary

12.3. Working with cluster gossip

12.3.1. Retrieving the cluster state

12.3.2. Handling cluster gossip messages

12.3.3. Working with cluster gossip messages summary

12.4. Cluster singleton

12.5. Cluster sharding

12.5.1. Creating a new shard

12.5.2. Communicating with actors in a shard

12.5.3. Handling passivation within shards

12.5.4. Akka.Cluster.Sharding summary

12.6. Distributed pub/sub

12.6.1. Topic messaging

12.6.2. Point to point messaging

12.6.3. Distributed publish subscribe summary

12.7. Cluster client

12.8. Akka.Cluster summary

13. Applying Akka.Net and reactive programming to a production problem

13.1. Designing with actors

13.2. Handling failure

13.3. Designing for scale

13.4. Handling configuration

13.5. Ingesting data

13.6. Testing

13.7. Real time integration

13.8. Data persistence

13.9. Cluster scale out

13.10. Conclusion

About the Technology

Reactive Applications with Akka.NET begins with an overview of reactive and a sample application written in the reactive style. You'll learn concepts of the actor model and what these mean in a real-world reactive context. This hands-on book builds on fundamental concepts to teach you how to create reliable and resilient applications. You'll also learn useful Akka.NET features for building real-world applications. By the end of the book, you'll be able to look at a problem domain and understand how to create applications which are able to withstand the demands of a modern day application.

What's inside

  • Real-world applications of Akka.NET and reactive applications
  • Designing an Internet of Things architecture with reactive in mind
  • Building applications to handle the demands of the modern era of software
  • Integrating Akka.NET with your existing .NET stack
  • Deploying Akka.NET applications to the cloud

About the reader

Readers should be comfortable with C# or F# and the .NET framework. No previous reactive experience needed.

About the author

Anthony Brown has been developing software for several years, primarily using the .NET framework. He's a regular speaker at conferences on tools and techniques to rapidly build systems that work.

Manning Early Access Program (MEAP) Read chapters as they are written, get the finished eBook as soon as it’s ready, and receive the pBook long before it's in bookstores.
MEAP combo $44,99 pBook + eBook + liveBook
MEAP eBook $35,99 pdf + ePub + kindle + liveBook

FREE domestic shipping on three or more pBooks