Questions tagged [akka-http]

The purpose of the Akka HTTP layer is to expose Actors to the web via HTTP and to enable them to consume HTTP services as a client. It is not an HTTP framework, it is an Actor-based toolkit for interacting with web services and clients.

The purpose of the Akka HTTP layer is to expose Actors to the web via HTTP and to enable them to consume HTTP services as a client. It is not an HTTP framework, it is an Actor-based toolkit for interacting with web services and clients.

More Info:

1489 questions
3
votes
1 answer

Akka-http: how to mock ActorMaterializer in unit test

I have a class A(httpClient: HttpExt)(implicit val system: ActorSystem, materializer: ActorMaterializer) that has a method called extractInfo (res: Future[HttpResponse]): Int that takes a future response and extracts an int value from the response…
Isa
  • 353
  • 2
  • 18
3
votes
1 answer

akka-http How to use MergeHub to throttle requests from client side

I use Source.queue to queue up HttpRequests and throttle it on the client side to download files from a remote server. I understand that Source.queue is not threadsafe and we need to use MergeHub to make it threadsafe. Following is the piece of code…
Anand
  • 1,791
  • 5
  • 23
  • 41
3
votes
1 answer

How to run sbt-revolver with a Scala project?

So I'm reading the documentation for sbt-revolver since I'm interest in using its: Triggered restart: automatically restart your application as soon as some of its sources have been changed It says in the documentation that it should work with any…
CommonSenseCode
  • 23,522
  • 33
  • 131
  • 186
3
votes
0 answers

Akka Http Parameter Validation

I have several get routes for my akka-http service; they all have the form: pathPrefix("compass") { path("route") { parameters(('srclat.as[Double], 'srclon.as[Double], 'destlat.as[Double], 'destlon.as[Double])) { (srclat,…
Timothy Perrigo
  • 723
  • 4
  • 18
3
votes
0 answers

Streaming Chunked HTTP Entities with vert.x

I'm beginning an initial review of vert.x and comparing it to akka-http. One area where akka appears to shine is streaming of response bodies. In akka-http it is possible to create a streaming entity that utilizes back-pressure which allows the…
Ramón J Romero y Vigil
  • 17,373
  • 7
  • 77
  • 125
3
votes
1 answer

Using akka-http client `entity.discardEntityBytes` with strict Unmarshaller

the akka-http client documentation states the following: Be sure to consume the response entities dataBytes:Source[ByteString,Unit] by for example connecting it to a Sink (for example response.discardEntityBytes() if you don’t care about the…
simao
  • 14,491
  • 9
  • 55
  • 66
3
votes
1 answer

akka http client follow redirect

The akka-http documentation provides an example to query a http service: http://doc.akka.io/docs/akka-http/current/scala/http/client-side/request-level.html how can I tell akka-http to automatically follow redirects, instead of receiving a…
David Portabella
  • 12,390
  • 27
  • 101
  • 182
3
votes
1 answer

Kafka topic to websocket

I am trying to implement a setup where I have multiple web browsers open a websocket connection to my akka-http server in order to read all messages posted to a kafka topic. so the stream of messages should go this way kafka topic -> akka-http ->…
Christopher Chiche
  • 15,075
  • 9
  • 59
  • 98
3
votes
1 answer

How do I chain routes (using `~`) which are the results of functions?

scala> import akka.http.scaladsl.server._; import Directives._ import akka.http.scaladsl.server._ import Directives._ Suppose I have two functions from some type (Int, say) to a Route: scala> lazy val r1: Int => Route = ??? r1: Int =>…
oxbow_lakes
  • 133,303
  • 56
  • 317
  • 449
3
votes
1 answer

Completing Source[ByteString, _] in Akka-Http

I wanted to use Alpakka for handling S3 upload and download with Akka Steams. However, I got stuck with using Source produced by S3Client within Akka Http routes. The error message I get is: [error] found :…
Mateusz Kubuszok
  • 24,995
  • 4
  • 42
  • 64
3
votes
1 answer

Akka http vs Lagom

Please help in understanding 1)Choosing Akka http vs Lagom for building a microservice 2)Is there any difference between REST API and Akka http/Lagom based microservice. Thanks
Tilak
  • 323
  • 1
  • 5
  • 18
3
votes
1 answer

What can I do to speed up IntelliJ IDEA when handling akka-http routes?

Update of syntax highlighting is incredibly slow, when editing even a simple route definition. Updates take seconds, which really breaks the edit/will-this-compile flow. I didn't have this before. Maybe something's changed. Are others experiencing…
akauppi
  • 17,018
  • 15
  • 95
  • 120
3
votes
1 answer

Akka Streams' ActorPublisher as a Source for web response - how back-pressure works

I use akka-streams' ActorPublisher actor as a streaming per-connection Source of data being sent to an incoming WebSocket or HTTP connection. ActorPublisher's contract is to regularly request data by supplying a demand - number of elements that can…
Tvaroh
  • 6,645
  • 4
  • 51
  • 55
3
votes
1 answer

Akka http losing sender reference

After receiving a Future[httpResponse] I'm trying to send the message to the sender but I'm loosing the reference of the sender. Here is the code of my receive method: def receive = { case Seq(method: HttpMethod, endpoint: String,…
Jean
  • 5,201
  • 11
  • 51
  • 87
3
votes
2 answers

Illegal inheritance, superclass X not a subclass of the superclass Y of the mixin trait Z - Scala

I am trying to execute a akka-http which is a scala program. My KISS code is as follows:- import akka.actor.ActorSystem import akka.http.scaladsl.Http import akka.http.scaladsl.model.{HttpRequest, HttpResponse} import…
sdinesh94
  • 1,138
  • 15
  • 32