scala Spray、Akka-http 和 Play,这是新 HTTP/REST 项目的最佳选择
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29228552/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Spray, Akka-http and Play, Which is the best bet for a new HTTP/REST project
提问by Fede
I'm going to develop new HTTP/REST services using Scala and Akka Actors.
我将使用 Scala 和 Akka Actors 开发新的 HTTP/REST 服务。
I have experience working with Play, but I don't really need a complete web Framework. From what I read, I think Spray is a suitable choice. My question come from the future of Spray after the new arrived AKKA-HTTP.
我有使用 Play 的经验,但我并不真正需要一个完整的 Web 框架。根据我的阅读,我认为喷雾是一个合适的选择。我的问题来自新出现的 AKKA-HTTP 之后 Spray 的未来。
Does the Spray project will grow independently from the Akka-HTTP project, or are the two project going to be merged into one Akka-HTTTP?
Spray 项目会独立于 Akka-HTTP 项目发展,还是将两个项目合并为一个 Akka-HTTP 项目?
What is the impact of this if I start developing with Spray? Also I read that Play will integrate AKKA-HTTP. So I finally wonder if a should not go with Play?
如果我开始使用 Spray 进行开发,这会产生什么影响?我还读到 Play 将集成 AKKA-HTTP。所以我终于想知道是否应该和 Play 一起去?
Thanks for your help.
谢谢你的帮助。
回答by Gangstead
Spray is production ready, but the development team (Mathias Doenitz) works for Typesafe on Akka-http now.
Spray 已准备好投入生产,但开发团队 (Mathias Doenitz) 现在在 Akka-http 上为 Typesafe 工作。
The status of Akka-http is "development preview". There are vague promises of a full release "within a few months", but nothing you can take to the bank.
Akka-http 的状态是"development preview"。有“几个月内”完全发布的模糊承诺,但您无法向银行提供任何信息。
Edited 29-July-2015:
2015 年 7 月 29 日编辑:
The status of Akka-HTTP is now "release candidate" with version 1.0 RC4. Its functionality is largely competing with spray.io, and the common expectation is that spray.io will lose it's development momentum. At this time I would not recommend spray.io for new projects anymore.
Akka-HTTP 的状态现在是 1.0 RC4 版的“候选发布版”。它的功能在很大程度上与spray.io竞争,普遍预期spray.io会失去发展势头。目前我不会再为新项目推荐spray.io。
Jonas Boner from Typesafe has referred to Akka-http as "Spray 2.0". So don't expect any future versions of Spray and at some point you'll have to make the switch. I saw Jonas' Akka-http presentation at Scala Days and it looks like porting Spray code to Akka-http should be straight forward as the DSL is mostly unchanged (even though the underlying implementation of the library will be different).
Typesafe 的 Jonas Boner 将 Akka-http 称为“Spray 2.0”。因此,不要指望任何未来版本的 Spray,在某些时候您将不得不进行转换。我在 Scala Days 上看到了 Jonas 的 Akka-http 演示,看起来将 Spray 代码移植到 Akka-http 应该很简单,因为 DSL 几乎没有变化(即使库的底层实现会有所不同)。
To answer your questions specifically: Spray is finished as a separate project, it is being imported into Akka under the name Akka-http (not a merge as Akka didn't have any equivalent before hand). If you need to start development now go with Spray, if you can afford to work with the inevitable bugs in a preview release go with Akka-http. Your Spray code will never stop working, but it won't be supported either outside of minor bug fixes. All new functionality will be added in Akka-http, so instead of updating to Spray 2.0 you update to Akka-http.
具体回答您的问题:Spray 作为一个单独的项目完成,它以 Akka-http 的名称导入 Akka(不是合并,因为 Akka 之前没有任何等效项)。如果您现在需要开始开发,请使用 Spray,如果您有能力处理预览版中不可避免的错误,请使用 Akka-http。您的 Spray 代码将永远不会停止工作,但除了小错误修复之外,它也不会得到支持。所有新功能都将添加到 Akka-http 中,因此您无需更新到 Spray 2.0,而是更新到 Akka-http。
回答by Nishan
You have already given answer to your question in your comment. As long as if you don't need to deal with UI I would suggest go with Akka-HTTP or Spray.io.
您已经在评论中回答了您的问题。只要您不需要处理 UI,我建议您使用Akka-HTTP 或 Spray.io。
I don't think you will have impact if you starts with Spray.io as there are many projects running their production environment on Spray.
如果您从 Spray.io 开始,我认为您不会产生影响,因为有许多项目在 Spray 上运行其生产环境。
For more details please refer below link.
欲知更多详情,请参阅以下链接。
Thanks
谢谢
回答by brunofitas
Well, if you have to learn everything from scratch, I would recommend choosing spray - Akka hhtp documentation is really incomplete and a lot of route directives are not implemented yet on akka.http. I started with akka but I was forced to go to spray...
好吧,如果您必须从头开始学习所有内容,我建议您选择喷雾 - Akka hhtp 文档确实不完整,并且在 akka.http 上还没有实现很多路由指令。我从 akka 开始,但我被迫去喷......
回答by soulmachine
Typesafe gets Spray(ed) | @typesafe
The Akka/Spray integration—named Akka HTTP—will provide an ideal way of producing and consuming embeddable REST services.
Akka/Spray 集成(名为 Akka HTTP)将提供一种生产和使用可嵌入 REST 服务的理想方式。
回答by SemanticBeeng
As per Johannes Rudolph
根据约翰内斯·鲁道夫
if you want to provide an HTTP interface to (maybe already existing) akka services, then that's what akka-http is for
如果您想为(可能已经存在的)akka 服务提供 HTTP 接口,那么这就是 akka-http 的用途
source: https://gitter.im/akka/akka?at=5874fc9761fac5a03dbe1a6f

