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

Implementing the Book read model


As usual, we'll take the plunge into our refactor with the inventory management module and the Book entity. We want to build out both ViewBuilder and View for Book so that we can build its read projection and be able to query against it again. We'll have to make some changes to our common code first so that we have a good framework to build our CQRS implementation on top of it. I'll start with describing those changes and then we can jump into the Book read-model implementation.

Supporting tagging in ProtobufDatamodelAdapter

When discussing the high-level approach we can use to build our read models, we decided that eventsByTag was the Persistence Query feature to leverage. We wanted to tag our events with two String tags—the entity type and the event type. We'll implement this tagging process in the ProtobufDatamodelAdapter class that we created in Detaching the domain model from the data model section in Chapter 4, Making History with Event Sourcing. Before...