Book Image

Mastering Akka

By : Christian Baxter
Book Image

Mastering Akka

By: Christian Baxter

Overview of this book

For a programmer, writing multi-threaded applications is critical as it is important to break large tasks into smaller ones and run them simultaneously. Akka is a distributed computing toolkit that uses the abstraction of the Actor model, enabling developers to build correct, concurrent, and distributed applications using Java and Scala with ease. The book begins with a quick introduction that simplifies concurrent programming with actors. We then proceed to master all aspects of domain-driven design. We’ll teach you how to scale out with Akka Remoting/Clustering. Finally, we introduce Conductr as a means to deploy to and manage microservices across a cluster.
Table of Contents (17 chapters)
Mastering Akka
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Preface

Creating RESTful interfaces with Akka HTTP


Now that we have a little background on REST in general, and how Akka HTTP evolved from Spray, it's time to dig in and understand how we can use the inbound Akka HTTP API to front our services with RESTful interfaces. Here, the goal for me will be to provide details on the low-level and high-level inbound HTTP APIs within Akka. Although refactoring later on will use the high-level routing, DSL-based API, it's important to understand what's happening under the hood with the low-level API first.

Before jumping into descriptions of the low and high-level APIs, it's important to understand the different modules that make up Akka HTTP. These modules are as follows:

  • akka-http-core: This is where the code for the low-level server and for the client-side HTTP API lives.

  • akka-http: This is where the high-level inbound HTTP API lives with things such as the routing DSL, marshalling, and compression/decompression included.

  • akka-http-testkit: This is where the...