Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Playframework 2.6.x: Why Akka HTTP is default from now?

The question is why Playframework team decided to migrate from Netty to Akka? Is it more efficient in performance meaning?

like image 954
Dante Avatar asked Sep 12 '17 07:09

Dante


People also ask

Why use akka HTTP?

Instead, Akka HTTP makes it easier to build integration layers based on HTTP, and therefore stays on the sidelines. This allows you to base your app on what makes sense and use Akka HTTP for HTTP integration. Akka HTTP is not a framework–not because we don't like frameworks–but to provide maximum flexibility.

Does akka HTTP use Netty?

Akka HTTP implements a full server stack for HTTP, including full HTTPS support, and has support for HTTP/2. The Akka HTTP server backend is the default in Play. You can also use the Netty backend if you choose.

What is akka stream?

Akka Streams is a module built on top of Akka Actors to make the ingestion and processing of streams easy. It provides easy-to-use APIs to create streams that leverage the power of the Akka toolkit without explicitly defining actor behaviors and messages.


1 Answers

Play switched to using Akka by default because:

  • Play already uses Akka and Akka streams internally, and the model Akka HTTP uses for representing requests and responses is much closer to Play's.
  • It's much easier for the Play team to work with the Akka team. This is in part due to shared philosophy and goals but also due to the fact that both teams work for Lightbend. It is hoped that this improved communication will help the Play team to implement new features and fix bugs and security issues more quickly.

The Play team believe that performance on Akka is at least as good as it is on Netty. Anyone who find this not to be true is encouraged to raise an issue with them.

All the above taken from an email thread on the Play dev list.

Note: Play continues to support Netty so if you'd rather use Netty then you can manually select it:

If for some reason you have both the Akka HTTP server and the Netty HTTP server on your classpath, you’ll need to manually select it. This can be done using the play.server.provider system property, for example, in dev mode:

run -Dplay.server.provider=play.core.server.NettyServerProvider

like image 59
glytching Avatar answered Dec 03 '22 08:12

glytching