- How do you map the endpoint with the query parameter to a REST call?
def answer(parameter: Int): ServiceCall[NotUsed, Done]
override def descriptor: Descriptor = {
import Service._
named("Answer").withCalls(
restCall(Method.POST, "/answer?parameter", answer _)
)
}
- What is the recommended serialization format for persistent entities?
Lagom's recommended serialization format is JSON.
- Can you explain why clustering is required in order to use persistence in Lagom?
Lagom's persistence is implemented on top of Akka persistence. Akka requires each persistent actor to have a unique persistence ID. In a microservice landscape, each service is supposed to have multiple instances at the same time. Without clustering, there will be multiple persistent actors with the same ID storing events into the same database, which will corrupt data...