I experience lots of Errors of such kind:
akka://scamandrill/user/StreamSupervisor-3/flow-25-0-unknown-operation]
Error in stage [One2OneBidi]: Inner stream finished before inputs
completed. Outputs might have been truncated.
(akka.http.impl.util.One2OneBidiFlow$OutputTruncationException$
Where to look for causes ?
Code for http-client is rather simple,
def executeQuery[S](endpoint: String, reqBodyF: Future[RequestEntity])(
handler: (HttpResponse => Future[S])): Future[S] = {
def rh(tryHttpInt: (Try[HttpResponse], Int)): Future[S] = {
tryHttpInt._1 match {
case Success(rsp) => if(rsp.status.isSuccess()) handler(rsp)
else {
Unmarshal(rsp.entity).to[String].flatMap ( msg =>
Future.failed(new
UnsuccessfulResponseException(rsp.status.intValue(),
rsp.status.reason(), msg))
)
}
case Failure(e) => Future.failed(e)
}
}
reqBodyF.flatMap { reqBody =>
val request = HttpRequest(method = HttpMethods.POST, uri = Uri(
"/api/1.0" + endpoint), entity = reqBody)
val clientFlow = Http().cachedHostConnectionPoolHttps[Int](
"mandrillapp.com")
val futureResponse = Source.single(request -> 1).via(clientFlow).map[
Future[S]](rh).runWith(Sink.head)
futureResponse.flatMap{ f => f }
}
}
source code:
https://github.com/marekzebrowski/scamandrill/blob/master/src/main/scala/com/joypeg/scamandrill/client/ScamandrillSendReceive.scala
passed handlers are also simple, spray-json unmarshalling with
unmarshal[List[MSenderDataResponse]]
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.