January 2017
Intermediate to advanced
420 pages
9h 25m
English
When writing your project, you should adhere to best practices and standards. A service interface should always be placed in a *-api project. You can see the HelloService interface follows the same rule. The requirement is for your service interface to extend the Lagom service interface and provide a default implementation for the descriptor method. The descriptor is responsible for mapping the service to the underlying transport protocol.
public interface HelloService extends Service { ServiceCall<NotUsed, String> hello(String id); ServiceCall<GreetingMessage, Done> useGreeting(String id); @Override default Descriptor descriptor() { return named("hello").withCalls( pathCall("/api/hello/:id", this::hello), pathCall("/api/hello/:id", ...Read now
Unlock full access