首页 文章
  • 1 votes
     answers
     views

    swagger api-docs到swagger.json?

    我正在使用Spray和最新版本的spray-swagger(0.5.1),我可以在swagger-ui中看到我的API文档 . 但是,spag-swagger使用从/api-docs开始的分层目录结构 . 我想使用其他与swagger相关的工具,而这些工具似乎更喜欢单个swagger.json文件 . 是否有任何工具可以将/ api-docs分层目录结构转换为单个swagger.json文件?
  • 4 votes
     answers
     views

    喷洒Akka Json Unmarshalling

    我有一个问题,通过使用spray - akka将对象解组到Json . 当我想使用返回Future [List [Person]]的actor时,它不起作用 . 如果我直接使用dao对象,它的工作原理 . 这是我的代码: PersonDao.scala import scala.concurrent.ExecutionContext.Implicits.global import scala....
  • 1 votes
     answers
     views

    在接收对等方的close_notify之前,Spray HTTPS Inbound已关闭

    目前,我正在使用Spray i / o实现Scala的Web服务 . 希望使用SSL来保护我的请求 . 但是我在配置SSL时遇到了困难 . 当启动https调用时,会出现与握手相关的错误 fatal error: 80: Inbound closed before receiving peer's close_notify: possible truncation attack? javax.ne...
  • 0 votes
     answers
     views

    喷涂和摇摆不兼容

    我正在用Scala和Spray做一个项目,我想生成一个我的API的自动文档 . 我找到的最好的工具是Swagger但是当我试图将它包含在我的项目中时,我遇到了一些问题 . 当我将 Swagger 添加到 build.sbt 并且我下载 swagger library 时,我的项目无法编译 . 不再检测到 spray.routing._ . 有谁怎么解决这个问题?我尝试使用不同版本的Spray&S...
  • 2 votes
     answers
     views

    我路线中的NullPointerException

    无法想出这个,但我得到了以下的栈路径: [错误] [09/06/2013 17:08:00.019] [example-akka.actor.default-dispatcher-5] [akka:// example / user / $ a]处理请求HttpRequest时出错(GET, / user / 12345abcd?service = YT,List(主机:localhost:80...
  • 2 votes
     answers
     views

    Akka整合并发数据库请求

    我希望能够对多个数据存储库发出并发请求并合并结果 . 我试图了解我的方法是否完全有效,或者是否有更好的方法来解决这个问题 . 我绝对是Akka / Spray / Scala的新手,我真的希望更好地了解如何正确构建这些组件 . 任何建议/提示将不胜感激 . 试图围绕使用演员和未来来实现这种类型的实现 . Spray Service: trait DemoService extends HttpSe...
  • 3 votes
     answers
     views

    将路由从spray.io迁移到akka http

    我正在努力将应用程序从Spray.io迁移到Akka-http . 该应用程序是基于微服务的,具有许多我们构建的小型库 . 以下是在一个特定的微服务中编写指令和路由的示例: val routes = (decompressRequest & compressResponseIfRequested) { metricsRoute ~ healthStatusRoute ~...
  • 2 votes
     answers
     views

    喷洒死信

    我正在尝试执行以下代码 trait CustomHttpService extends HttpService { import MyJsonProtocol._ import spray.httpx.SprayJsonSupport._ implicit def executionContext = actorRefFactory.dispatcher implicit va...
  • 9 votes
     answers
     views

    在发生故障时解决Akka期货问题

    我在Spray应用程序中使用ask模式调用Actor,并将结果作为HTTP响应返回 . 我将演员的失败映射到自定义错误代码 . val authActor = context.actorOf(Props[AuthenticationActor]) callService((authActor ? TokenAuthenticationRequest(token)).mapTo[LoggedInU...
  • 1 votes
     answers
     views

    Akka - Sender [null]发送了类型的消息

    我有一条喷雾路线,我宣布我的一个演员 . val myActor = actorRefFactory.actorSelection("/user/my-actor") 我的路线看起来像: get { path(Segment / Segment) { (poolId, trackId) => respondWithMediaType(MediaTypes.`...
  • 1 votes
     answers
     views

    Scala未来是否会阻止长期操作?

    在任何地方我们都可以读到,在执行长时间运行操作或阻塞操作时,最好使用特殊的执行上下文 . 阻止访问数据库等操作 . 我理解为什么 . 这是为了避免线程饥饿 . 我们不希望“8”可用线程忙于一些可能最终返回或阻塞的阻塞代码 . 它要么严重减慢应用程序的速度,要么无限期地阻止它 . 同时,我想知道Spray或Play之类的东西是如何实现的 . 实际上,让我们采取客户端 . 发送请求时,我们会得到未来的...
  • 3 votes
     answers
     views

    unmarshall嵌套json in spray-json

    使用spray-json(因为我正在使用spray-client)来获取google maps API中的纬度,经度对象,我需要设置整个响应结构: case class AddrComponent(long_name: String, short_name: String, types: List[String]) case class Location(lat: Double, lng: Dou...
  • 2 votes
     answers
     views

    AbstractMethodError使用spray和akka

    我想用喷雾和akka制作一些web服务 . GET请求工作正常(获取元素列表,值...使用spray-json)但是我的身份验证请求,我得到了一个预测,我不知道为什么 . 我做了一些单元测试,看看序列化/反序列化是否适用于marshallers,我看到一个格式良好的json对象 . 这是我的堆栈跟踪: Uncaught error from thread [on-spray-can-akka.a...
  • 4 votes
     answers
     views

    不能用喷射json来解散json HttpEntity

    我试图只运行documentation中的简单示例而不做任何更改: import spray.json.DefaultJsonProtocol import spray.httpx.unmarshalling._ import spray.httpx.marshalling._ import spray.http._ import HttpCharsets._ import MediaTypes....
  • 3 votes
     answers
     views

    akka spray:java.lang.IllegalArgumentException:要求失败

    我是akka喷雾中的新人:) 我有这个路由器演员: class ProjectResource extends HttpServiceActor with DefaultJsonFormats { import spray.http.MediaTypes.`application/json` def receive = runRoute { pathPrefix("r...
  • 0 votes
     answers
     views

    akka spray - > akka http migration

    这是我的路由器在基于喷雾的服务中的片段: path(baseUrl / version / "apps" / Segment / "users" / Segment) { (app, user) => respondWithMediaType(MediaTypes.`application/json`) { ctx => create...
  • 0 votes
     answers
     views

    spray-json反序列化问题

    case class Box(id: String, container: Container) case class Container(id: String, boxes: List[Box]) object CustomProtocol extends DefaultJsonProtocol { implicit object BoxFormat extends RootJ...
  • 1 votes
     answers
     views

    Tomcat中的Spray Client(即AKKA)导致线程问题

    我在Tomcat webApp中使用喷雾客户端即akka . 虽然我通过spring正确地破坏了tomcat关闭时的actor系统,但我仍然面临着这个线程问题 . 我发现几年前Tomcat complaints when re-deploying servlet with akka inside已经报告过这个问题,但找不到解决方法 我正在使用默认的spray-client配置 . 这是我停止tom...

热门问题