Migrating from Spray to Akka
Spray is a well-known HTTP library in the Scala ecosystem. It was released in 2011, and since then it’s been widely used by the Scala community. It was recently announced that Spray would be replaced with Akka HTTP, thus cementing Akka HTTP as the successor of Spray. It’s maintained by Lightbend and it’s been recommended that users migrate to it soon.
However, migration from one major version of a library to another is not an easy task. Very often it requires you to spend some time reading the source code in order to figure out how to use certain features, as well as how to migrate existing logic.
This post will demonstrate what changes should be applied in order to migrate your app from Spray to Akka HTTP. The following steps don’t have a particular order, as it depends on which areas need to be rewritten.