How it works...
In this recipe, we covered how service implementation is done for Lagom services. In this particular example, we create a simple token service that authenticates a user and provides a token. Then, the token can be validated. This service is not backed by any database and it's only for demonstration purposes. To begin with, we define our modules in our build.sbt file and add them to the aggregate of the project definition. Once the directory structure gets created, we define our API module. The API module defines both the service interface as well as the messages that are exchanged by this service. In this case, the service calls defined are retrieveToken and validateToken inside the TokenService file. We can see that both ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access