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

Chapter 7. REST Easy with Akka HTTP

When building out a services-oriented or microservices architecture, you'll expose your services so that they can be called remotely over a network. You can choose to do so by leveraging whatever remoting protocol is native to your programming language of choice. In the Java world, this could mean using Java serialization and RMI, or even EJB, to communicate between your services. The problem with this approach is that it locks you into that language, making it difficult or even impossible to introduce services written in another language.

As your architecture grows bigger, it's not realistic to think that all of your services will always be written in the same language and will communicate with that language's native remoting protocol. Additionally, if you ever want to expose some of your business functionality outside your own software, like an external API, then having a language-specific API will only limit that API's adoption. When faced with such...