-
Notifications
You must be signed in to change notification settings - Fork 3
Migrate from Spray to Akka-Http #11
Conversation
… server communicates with the marketplace instead management UI website itself
…uthorization header -> use akka Authorization object instead of strings
…containing slashes
…umer is only possible with the correct token in the auth header
…ble to properly test signature validation (cannot add offers in tests)
"commons-codec" % "commons-codec" % commonsCodecV, | ||
"net.debasishg" %% "redisclient" % redisClientV, | ||
"com.lihaoyi" %% "scalarx" % scalarxV | ||
"io.spray" %% "spray-json" % sprayV, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we do not leave out spray completely?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. The libraries spray-servlet
, spray-routing
, spray-can
, and spray-testkit
are removed/replaced with Akka libraries. There should be other libraries available to parse json besides spray-json
. But Akka's documentation about json parsing is for some reason focused on spray-json. That's why I left this in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok ... trusting you here with the rest since I am not in any way familiar with Scala. :(
The Spray library is no longer maintained. Akka-Http is the recommended successor. This PR migrates the codebase from Spray to Akka-Http.
This should also make it easier to use Websockets for sales notifications for a future pull request. I won't be able to finish that until mid October (and thus do not continue working on it). However, this migration is still beneficial because we can replace an obsolete dependency with an actively maintained one.
Here are changes that come with this PR:
I updated all tests and documented in the README how to run them. Some Offer tests are disabled because currently offer signatures cannot be tested properly. Testing requires setting up three services (kafka, redis, postgres). This is quite some inconvenience. Kafka could be stubbed out but redis and postgres are essential to test marketplace functionality.
The spray library is mostly removed, only spray-json is remaining to transform request data to our data objects and vice versa. It should be possible to do that without spray-json, but don't know a better way yet.