General questions on move from Spray to Akka.http

281 views
Skip to first unread message

Jacobus

unread,
Apr 23, 2015, 9:31:00 AM4/23/15
to spray...@googlegroups.com
Good day,

My gut feel is that Akka.HTTP is getting ready for primetime, so building a new project on it should be safe.... hope I'm right.

I just want to know if the Spray Json library will be kept alive as part of Akka.Http (it's in there at the moment), or if one should start using Play Json. Don't know if it makes sense for TypeSafe to have to Json libraries in the long term or if they are really doing two different things.

The benchmark below (a little dated) shows Play Json to be faster, but speed is not an absolute criteria for choosing a technology:
http://derekwyatt.org/2014/01/15/benchmarking-spray-json-argonaut-play-json.html

Anyways, if someone started a new project today, that would be done in a month or two, will it make better sense to use:

- Spray with Spray Json
- Akka.Http with Spray Json
- Akka.Http with Play Json

Nothing to serious, but making the right choices is not a bad thing ;-)

Oh, lastly, should one use the Spray or Akka user's lists to discuss Akka.http?

Thanks and cheers,
Jacobus

p.s. My pet git project was called S4, Spray Slick Starter Stack, lol, I'm going to sit with a misnomer soon.

nic

unread,
Apr 23, 2015, 11:06:21 PM4/23/15
to spray...@googlegroups.com
I did my own benchmark recently. https://github.com/nlw0/scala-json-benchmark

Spray-json apparently has a great performance today, since it moved to a custom parser, so that should not be a concern anymore. But I'm still confused myself about which library to pick for my projects. BTW, Spray also supports Lift/json4s, you might consider trying it too. As if there wasn't enough confusion!

Cheers,
    ++nic

Mathias Doenitz

unread,
Apr 24, 2015, 5:34:53 AM4/24/15
to spray...@googlegroups.com
@nic

Thanks for the pointer to your benchmark!
While your results are definitely interesting I’d really recommend to move to JMH as a benchmark harness, [sbt-jmh](https://github.com/ktoso/sbt-jmh) makes things really easy here.
JMH will help a lot in dealing with the many common benchmarking pitfalls on the JVM.

> My gut feel is that Akka.HTTP is getting ready for primetime, so building a new project on it should be safe.... hope I'm right.

Yes, things are getting better and better.
In fact we are in the process of finalising RC1 as we speak, so expect a pretty good release in the next days.

> I just want to know if the Spray Json library will be kept alive as part of Akka.Http (it's in there at the moment), or if one should start using Play Json. Don't know if it makes sense for TypeSafe to have to Json libraries in the long term or if they are really doing two different things.

spray-json is not part of Akka HTTP in the same way as it has never been part of the actual spray releases.
It is a stand-alone JSON library and will, for the time being, stay that way.

But you are right, it makes sense for Typesafe to unify things here and, in fact, such an initiative already exists.
The problem is that capacity is low on all fronts and higher prio project keep preventing progress here.
Hopefully this will change at some point.

> But I'm still confused myself about which library to pick for my projects. BTW, Spray also supports Lift/json4s, you might consider trying it too. As if there wasn't enough confusion!

At the time we started spray-json there wasn’t really any usable alternative. This has changed a lot since then and meanwhile it’s a question of your preferred style and priorities.
And while spray of course always supported spray-json we were always careful to also support alternatives as properly as possible.
This is why spray has out-of-the-box support for spray-json, list-json, play-json and JSON4S.
And writing the necessary glue code for supporting any other JSON solution is also not hard at all.

Akka HTTP will follow the same approach: provide out-of-the-box for all commonly used JSON libraries and make it easy to integrate your own.

Cheers,
Mathias

---
mat...@spray.io
http://spray.io
> --
> You received this message because you are subscribed to the Google Groups "spray.io User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to spray-user+...@googlegroups.com.
> Visit this group at http://groups.google.com/group/spray-user.
> To view this discussion on the web visit https://groups.google.com/d/msgid/spray-user/3a2dc7ae-3444-48dc-960e-36b8d28fe6a2%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Jacobus

unread,
May 5, 2015, 3:47:51 AM5/5/15
to spray...@googlegroups.com
Ah, shucks, just noticed I never said thanks.

So here goes: Thanks for the great responses gents.

@Mathias, great work you and your team did on Akka-HTTP! I've started using it in our latest project, and so far so good! Really well done in keeping the directives and routes so familiar. It's an easy transition. Thanks!!!

Cheers,
Jacobus

Mathias Doenitz

unread,
May 7, 2015, 5:52:29 AM5/7/15
to spray...@googlegroups.com
Thanks for the feedback, Jacobus!

Cheers,
Mathias

---
mat...@spray.io
http://spray.io

> --
> You received this message because you are subscribed to the Google Groups "spray.io User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to spray-user+...@googlegroups.com.
> Visit this group at http://groups.google.com/group/spray-user.
> To view this discussion on the web visit https://groups.google.com/d/msgid/spray-user/df682200-02af-4ad4-839f-d1f2f817929a%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages