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

Testing the bookstore modules in ConductR


In the previous section, we created a new book entity as part of our testing to get the inventory-management module up and running. Our ultimate goal of testing things is to create a new SalesOrder, and having a book in the system with inventory on it is one of the preconditions to creating that SalesOrder. As the book does not yet have an inventory on it, we will need to add one before we can use that book in a SalesOrder. The command to add inventory to that book is as follows:

http PUT boot2docker:9000/inventory-management/api/book/<book_id>/inventory/10

If you didn't save the book ID from earlier, then just run the lookup by tag query, shown in the previous section, to get the full Book JSON back, and grab the ID from there. Running this command will add the necessary inventory to the book so that we can create SalesOrders against it.

The other requirement to create a SalesOrder is to have a BookstoreUser in the system. You may already have...