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
5
votes
1 answer

Akka flow for multiple http requests

In a project of mine I have an akka actor for sending post requests to my google fcm server. The actor takes a list of ids and should make as many requests as there are in the list. I print out the response from the server in runForeach(println(_))…
Lukasz
  • 2,257
  • 3
  • 26
  • 44
5
votes
1 answer

Streaming file from server to client using Akka

Basically I want to allow a user to download a csv file from the server. Assume the CSV file already exists on the server. A API endpoint is exposed via GET /export. How do I stream the file from Akka HTTP server to client? This is what I have so…
perry
  • 85
  • 5
5
votes
1 answer

Do scala futures continue running after response in akka-http?

I have a REST service written in akka-http which exposes a /fire endpoint. When that endpoint is called my service should send a file, usually of ~50MB to a different service. But the /fire endpoint should return immediately to the caller and keep…
Fr.Usai
  • 384
  • 2
  • 17
5
votes
2 answers

akka-http queries do not run in parallel

I am very new to akka-http and have troubles to run queries on the same route in parallel. I have a route that may return the result very quickly (if cached) or not (heavy CPU multithreaded computations). I would like to run these queries in…
ogen
  • 802
  • 2
  • 7
  • 23
5
votes
0 answers

Do i need to create ActorMaterializer multiple times?

I have an app that generate reports, with akka-http + akka-actors + akka-camel + akka-streams. When a post request arrives , the ActiveMqProducerActor enqueue the request into ActiveMq Broker. Then the ActiveMqConsumerActor consumes the message and…
gaston
  • 498
  • 7
  • 15
5
votes
2 answers

Obtaining the client IP in Akka-http

I am trying to write an Akka HTTP microservice (akka version 2.4.11, Scala version 2.11.8, both latest versions at time of writing) which is aware of the client service's IP (i.e., remote address), and I cannot get this to work. I can create and run…
ScalaNewbie
  • 51
  • 1
  • 4
5
votes
1 answer

Postman gives error for REST based POST methods

I am using POSTMAN app for doing REST call (POST, GET) to my Scala Akka Application. if i do the same call from angularJS it works but when i fire it from POSTMAN it gives following error : There was a problem with the requests…
Nilesh
  • 2,054
  • 3
  • 23
  • 43
5
votes
1 answer

How to keep connection open for all the time in websockets

Server code : object EchoService { def route: Route = path("ws-echo") { get { handleWebSocketMessages(flow) } } ~ path("send-client") { get { sourceQueue.map(q => { println(s"Offering message from server") …
invariant
  • 8,758
  • 9
  • 47
  • 61
5
votes
2 answers

How to retry failed Unmarshalling of a stream of akka-http requests?

I know it's possible to restart an akka-stream on error with a supervision strategy on the ActorMaterialzer val decider: Supervision.Decider = { case _: ArithmeticException => Supervision.Resume case _ =>…
Guillaume Massé
  • 8,004
  • 8
  • 44
  • 57
5
votes
1 answer

Websocket with async handler

I can't get Akka http websockets to work with connection.handleWithAsyncHandler. Here is my code in scala (i'm using the latest version of akka http) import akka.actor.ActorSystem import akka.http.scaladsl.Http import…
mravey
  • 4,380
  • 2
  • 21
  • 31
5
votes
1 answer

How to generically wrap a Rejection with Akka-Http

I would like to use the Akka Http routing system, along with its rejection system but need to nest the response Json for a rejection within a generic Json message block. I have this working in a very non-generic manner creating a RejectionHandler…
AlexC
  • 10,676
  • 4
  • 37
  • 55
5
votes
1 answer

akka-http : could not find implicit value for parameter unmarshalling

My spray json support looks like this object MarshallingSupport extends SprayJsonSupport { implicit def json4sFormats: Formats = DefaultFormats } And in my route I want to map the request to a dto object Main extends App with AppConfig with…
Reeebuuk
  • 1,363
  • 2
  • 21
  • 42
5
votes
0 answers

Can I use play framework with akka http(not the one in play) and disable the netty server?

I'm not meaning the way play disabling PlayNettyServer and enable AkkaHttpServer which is described in the documentation by using: lazy val root = (project in file(".")) .enablePlugins(PlayScala, PlayAkkaHttpServer) …
Wayne Wang
  • 163
  • 9
5
votes
2 answers

Idiomatic way to use Spark DStream as Source for an Akka stream

I'm building a REST API that starts some calculation in a Spark cluster and responds with a chunked stream of the results. Given the Spark stream with calculation results, I can use dstream.foreachRDD() to send the data out of Spark. I'm sending…
user3474104
  • 85
  • 1
  • 9
5
votes
3 answers

akka-http chunked response concatenation

I'm using akka-http to make a request to a http service which sends back chunked response. This is how the relevant bit of code looks like: val httpRequest: HttpRequest = //build the request val request =…
Caballero
  • 11,546
  • 22
  • 103
  • 163