Skip to content
This repository has been archived by the owner on Aug 24, 2020. It is now read-only.

Migrate from Spray to Akka-Http #11

Merged
merged 14 commits into from
Oct 15, 2018
Merged

Migrate from Spray to Akka-Http #11

merged 14 commits into from
Oct 15, 2018

Conversation

CarstenWalther
Copy link
Collaborator

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:

  • Remove CORS support. CORS is no longer needed since the change how the management UI communicates with Price Wars services
  • Run a standalone application instead of a tomcat webserver (this is recommended by Akka)
  • Remove unused libraries
  • Removed some unused code path

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.

"commons-codec" % "commons-codec" % commonsCodecV,
"net.debasishg" %% "redisclient" % redisClientV,
"com.lihaoyi" %% "scalarx" % scalarxV
"io.spray" %% "spray-json" % sprayV,
Copy link
Contributor

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?

Copy link
Collaborator Author

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.

Copy link
Contributor

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. :(

@Bouncner Bouncner merged commit 82b7559 into master Oct 15, 2018
@Bouncner Bouncner deleted the akka-http branch October 15, 2018 19:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants