Just before the end of 2019, our engineering team made two releases nearly simulatenously: Play 2.8, and Lagom 1.6. In this short post, we sit down with members of the Play and Lagom team to ask what the major improvements are, the most significant updates, and what's coming in the future roadmap. We hope you enjoy!
We can summarize the most substantial improvements to Play and Lagom as follows, and we welcome you to also read more details about these releases on the project websites: What’s new in Play 2.8 and What is new in Lagom 1.6.
As the Akka Team said in the announcement for Akka 2.6, Akka Typed represents a major shift in the Akka ecosystem towards type-safety and more explicit guidance with Actors. We’re happy to be able to bring this to all Play and Lagom users, as well. Both Play and Lagom include dependency injection support for Actors in Akka 2.6.
While the Lagom Persistence API is still supported and maintained, the new Akka Persistence API in Akka 2.6 is now the recommended default for persistence. This provides a more flexible API that gives you greater control over some lower-level details, while retaining the opinionated and guided approach that Lagom introduced. Akka Persistence can coexist with existing persistent entities, and the same read-side processor and topic producer APIs fully support both types of entities.
The Lagom Team discovered that programmatically stopping and resuming Lagom’s Read Side processors was a bit more complicated than originally assumed. This presented some challenges trying to keep the state of the projection consistent across the cluster of Lagom nodes. Thankfully, Akka’s Distributed Data module provided the perfect tool for the job.
The problem boiled down to this: once you deployed a Lagom service, all projections would eagerly start. Then, if a projection had an error, it would get stuck due to a head-of-line issue, which isn’t a big deal for most people, aside from causing a lot of noise in logs.
In specific cases, however, we found that controlling when and which projections start actually provides them the necessary control to keep a hot backup instance of a service on a separate data center that is not executing the projections, leading to data corruption and inconsistencies. So, it was a challenge to make this all work, but by borrowing some tricks from Akka, we achieved what we needed to do.
In Play, we changed some things that had been bothering us, such as the final updates to remove global state, improvements to the Results APIs, and introduced a clear dependency graph for your tests when deciding between Akka HTTP and Netty server backends.
While not a bug per se, we made some improvements to various defaults in Lagom to provide a better out-of-the-box experience. For example, java.time.* serializers now use ISO-8601, and Kafka defaults to only one max inflight request per connection to reduce the chances of duplication or reordering of messages.
As we mentioned above, this release was really about making sure the Play and Lagom are both able to take advantage of the underlying technology provided by Akka 2.6.
This means that Lightbend customers using Play and Lagom can take advantage of enhancements in Lightbend Telemetry for Akka 2.6, as well as get support for the latest Scala version (2.13) and LTS Java version (11)–as well as the earlier Scala 2.12 and Java 8 versions.
We’re continuing the move toward more integration between Akka, Play, and Lagom in the future. Some of these ideas include combining the development environments for Play and Lagom, bringing Lagom’s support for Akka Cluster formation into Play, and incorporating major updates that we’re making to Akka Persistence Cassandra, Akka Persistence JDBC, and Alpakka Kafka. We’re also looking at Lightbend Telemetry support for read-side processors, a popular request from Lightbend subscribers.
This focus on integration means that we don’t have as many new features planned for Play and Lagom in the next few months, but this is a great opportunity for community members to contribute in the areas most meaningful to them. If you’re looking for ideas, try the “help wanted” or “good first issue” labels in the GitHub issues for Play and Lagom.
Want to see Play and Lagom in action? Schedule a demo to see Play and Lagom in production, including observability and metrics provided by Lightbend Console and Lightbend Telemetry.