Spray with Akka 2.4 Support? Pipelining

603 views
Skip to first unread message

Andrew James Ramirez

unread,
Jan 22, 2015, 10:07:10 AM1/22/15
to spray...@googlegroups.com
Is there a nightly build? or experimental repo that have akka 2.4 support?

I tried forcing it but it gives me this error when trying to do a HttpRequest :

Uncaught error from thread [smsr-akka.actor.default-dispatcher-20] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[smsr]
java.lang.NoSuchMethodError: akka.pattern.AskableActorRef$.$qmark$extension(Lakka/actor/ActorRef;Ljava/lang/Object;Lakka/util/Timeout;)Lscala/concurrent/Future;
at spray.client.pipelining$$anonfun$sendReceive$1.apply(pipelining.scala:38)
at spray.client.pipelining$$anonfun$sendReceive$1.apply(pipelining.scala:38)
at scala.Function1$$anonfun$andThen$1.apply(Function1.scala:55)
at spray.httpx.TransformerAux$$anon$2$$anonfun$apply$1.apply(TransformerPipelineSupport.scala:55)
at spray.httpx.TransformerAux$$anon$2$$anonfun$apply$1.apply(TransformerPipelineSupport.scala:55)
at spray.httpx.TransformerAux$$anon$2$$anonfun$apply$1.apply(TransformerPipelineSupport.scala:55)
at spray.httpx.TransformerAux$$anon$2$$anonfun$apply$1.apply(TransformerPipelineSupport.scala:55)
at spray.httpx.TransformerAux$$anon$2$$anonfun$apply$1.apply(TransformerPipelineSupport.scala:55)
at spray.httpx.TransformerAux$$anon$2$$anonfun$apply$1.apply(TransformerPipelineSupport.scala:55)
at spray.httpx.TransformerAux$$anon$2$$anonfun$apply$1.apply(TransformerPipelineSupport.scala:55)
at spray.httpx.TransformerAux$$anon$2$$anonfun$apply$1.apply(TransformerPipelineSupport.scala:55)
at spray.httpx.TransformerPipelineSupport$WithTransformerConcatenation.apply(TransformerPipelineSupport.scala:37)
at com.oberthur.mconnect.otaclient.services.OTAService$$anonfun$receive$1.applyOrElse(OTAService.scala:38)
at akka.actor.Actor$class.aroundReceive(Actor.scala:465)
at com.oberthur.mconnect.otaclient.services.OTAService.aroundReceive(OTAService.scala:13)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
at akka.actor.ActorCell.invoke(ActorCell.scala:487)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:257)
at akka.dispatch.Mailbox.run(Mailbox.scala:224)
at akka.dispatch.Mailbox.exec(Mailbox.scala:234)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)


Any suggestion? It points to this files 

Sorry for the newbie question. :D


Mathias Doenitz

unread,
Jan 27, 2015, 3:50:50 AM1/27/15
to spray...@googlegroups.com
Andrew,

no, there is no spray for Akka 2.4 and there probably won’t be.
Akka 2.4 comes with akka-http with is essentially spray 2.0, give it a try!

Cheers,
Mathias

---
mat...@spray.io
http://spray.io
> --
> You received this message because you are subscribed to the Google Groups "spray.io User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to spray-user+...@googlegroups.com.
> Visit this group at http://groups.google.com/group/spray-user.
> To view this discussion on the web visit https://groups.google.com/d/msgid/spray-user/7b7d65f5-966b-4c8b-a1f4-ba210a883c7a%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Jim Hazen

unread,
Feb 6, 2015, 6:31:48 PM2/6/15
to spray...@googlegroups.com
I'm in the same boat.  I need Akka 2.4 for Cluster Sharding rememberEntries support.  The akka-http docs are getting good wrt to server programming, but how to construct a streaming client isn't obvious (to me) and the docs are still todo.  The APIs do appear to be there in M3.  Can you point us to some akka-http client examples?

Thanks,
Jim

Jim Hazen

unread,
Feb 6, 2015, 9:17:38 PM2/6/15
to spray...@googlegroups.com
I'm going to answer my own question.  There are probably ways to polish this interaction, but this seems to work, mostly.  This seems to deadlock every 5th request.  Dunno why.

package streams

import akka.actor.ActorSystem
import akka.http.Http
import akka.http.client.RequestBuilding._
import akka.http.model.HttpResponse
import akka.stream.ActorFlowMaterializer
import akka.stream.scaladsl.{Sink, Source}

object StreamClientTest extends App {
  import scala.concurrent.ExecutionContext.Implicits.global

  implicit val system = ActorSystem("A4Wall")
  implicit val materializer = ActorFlowMaterializer()

  val host = "akka.io"
  val uri = s"http://$host/"
  val client = Http(system).outgoingConnection(host, 80).flow

  val eventuallyResponse = Source.single(Get("/")).via(client).runWith(Sink.head[HttpResponse])
  for(response <- eventuallyResponse;
      body <- response.entity.dataBytes.runWith(Sink.head))
  {
    println(s"Body:\n ${body.decodeString("UTF-8")}")
    system.terminate()
  }

}


Zack Angelo

unread,
May 14, 2015, 2:58:37 PM5/14/15
to spray...@googlegroups.com
I'm also in a rock and a hard place because I need to use Akka 2.4, but can't use akka-http because I need HTTPS support. 

Are there any examples out there for how to manually wire up the bidi flows to add SSL/TLS support onto my connections? 
Reply all
Reply to author
Forward
0 new messages