为什么所有HttpResponse都被发送到死信(到目前为止工作正常)?

时间:2015-01-31 11:41:41

标签: scala akka spray

今天早上我的代码停止了工作。现在,所有HttpResponse错误地发送到deadLetter。可能是什么问题?

class MyActor extends Actor {

  val mediator = DistributedPubSubExtension(context.system).mediator

  def receive = {
    case "tick" => {
      val pipeline = sendReceive ~> unmarshal[MyItems[Id]]
      val pipeline2: HttpRequest => Future[HttpResponse] = sendReceive

      val responseFuture: Future[MyItems[Id]] = pipeline(Get(path))
      responseFuture onComplete {
        case Success(json_items: MyItems[Id]) =>
          mediator.tell(DistributedPubSubMediator.Publish("I have response", ResponseTime(format.format(Calendar.getInstance().getTime())), self)  
        case Failure(t) => println("An error has occured: " + t.getMessage)
      }
    }
  }
}

1 个答案:

答案 0 :(得分:0)

问题是服务器正在发送不同的消息,而且它们无法解析为MyItems对象,因此导致错误,服务器响应被转发给了动态。