What Akka version are you on?

We have a similar issue reported but in a slightly different place...
https://github.com/akka/akka/issues/19981

What is the server responding with specifically?
I'd be very suprised if on a normal usual response we fail toStricting()
this is used by all tools, including some at Lightbend so that would have
come up already hm..


On Tue, Aug 16, 2016 at 1:08 AM, Sarah Yin <smile.sarah....@gmail.com>
wrote:

> Hi Akka User,
>
> I've been trying to Unmarshall HttpResponse and decode it as a String.
> However All the method I've searched failed in "Error in stage
> [unknown-operation]: Promise already completed"
>
> Has anyone come to this before? Thanks in ad!
>
> Here are the Future I want to decode
>
>> val responseFuture: Future[HttpResponse] = 
>> Http().singleRequest(HttpRequest(uri
>> = uri))
>
>
>
>>
> Here are some of the methods I've tried:
>
> responseFuture onComplete {
>> case Success(response) =>
>> val timeout = 300.millis
>> response.status match {
>> case StatusCodes.OK =>
>> println("printing content")
>> // println(response.entity.dataBytes.runForeach(println))
>> // println(response.entity.dataBytes.map(_.utf8String))
>> // response.entity.dataBytes
>> // .map(line => println(line))
>> // println(response.entity.toStrict(5 seconds).map(_.data.
>> decodeString("UTF-8")))
>> // println(Unmarshal(response.entity).to[String])
>> // val entity = Unmarshal(response.entity).to[String]
>> // entity onComplete { entity =>
>> // println(entity)
>> // }
>> // Unmarshaller.entityToString(response.entity)
>> // println(PredefinedFromEntityUnmarshallers.stringUnmarshaller(
>> response.entity))
>> // println(response.entity.toStrict(5 
>> seconds).map(_.data.decodeString("UTF-8"))
>> )
>> val bs: Future[ByteString] = response.entity.toStrict(timeout).map {
>> _.data }
>> // val s: Future[String] = bs.map(_.utf8String)
>> println(bs)
>> case _ =>
>> println("failed to get dynamic url")
>> }
>> case Failure(error) =>
>> println(error.toString)
>> }
>
>
>
>
>
> --
> >>>>>>>>>> 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 akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Cheers,
Konrad 'ktoso' Malawski
Akka <http://akka.io/> @ Lightbend <http://lightbend.com/>

-- 
>>>>>>>>>>      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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to