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

Akka-http illegal request header

I have exposed a simple endpoint that takes in two query parameters. When I test the code locally I don't have any problems. But when deployed to prod I see the following message: a.a.ActorSystemImpl Illegal request header: Illegal 'cookie' header:…
zaxme
  • 1,065
  • 11
  • 29
4
votes
0 answers

Akka Http majority of cpu time spent in Unsafe.park()

I am writing an an Akka Http service (v2.4.2) service for talking to a cassandra instance. Running the service on my laptop, it appears not to scale with the number of simultaneous connections. ~/workspace/wrk $ ./wrk -t8 -c32 -d30s -s…
Dylan Wilder
  • 166
  • 1
  • 9
4
votes
1 answer

Load Balancing akka-http

I am using akka-http, my build.sbt configuration is: scalaVersion := "2.11.7" libraryDependencies += "com.typesafe.akka" % "akka-actor_2.11" % "2.4.2" libraryDependencies += "com.typesafe.akka" % "akka-http-experimental_2.11" %…
George C
  • 1,168
  • 13
  • 30
4
votes
1 answer

What webserver uses akka akka-http and how can I get the version of it?

I'm using akka and akka-http 2.4.2 and I'm trying ti understand the internal components of them. What does akka and akka-http use to start a rest web-service? It uses an embebedd webservice? (like Jetty?) How do I get the version of it? The code I…
George C
  • 1,168
  • 13
  • 30
4
votes
2 answers

Circuit breaker for Scala and akka-http rest service

I am currently implementing a circuit breaker with Akka-HTTP as follows: def sendMail(entity: MyEntity): ToResponseMarshallable = { Thread.sleep(5 * 1000) validateEntity(entity).map[ToResponseMarshallable] { case (body,…
Lucian Enache
  • 2,510
  • 5
  • 34
  • 59
4
votes
1 answer

How to read a json response from a akka-http response entity using json4s

I am trying to invoke the google geocoding api and retrieve the response. lazy val geoCodingConnectionFlow: Flow[HttpRequest, HttpResponse, Any] = Http().outgoingConnectionHttps(config.getString("services.geoCodingApiHost"),…
Phani
  • 1,851
  • 2
  • 15
  • 28
4
votes
1 answer

Akka-Http Websockets: How to Send consumers the same stream of data

I have a WebSocket that clients can connect to I also have a stream of data using akka-streams. How can I make it that all clients get the same data. At the moment they seem to be racing for the data. Thanks
Ciaran0
  • 428
  • 5
  • 15
4
votes
1 answer

Akka actor system with HTTP interface

I'm trying to create an Akka system which would among other things respond to HTTP requests. I created a few actors who exchange messages fine. I can also use akka-http to respond to HTTP requests. The problem is in connecting those two…
Wojciech Ptak
  • 683
  • 4
  • 14
4
votes
0 answers

document microservice built using akka-http with swagger

I am trying to build microservices with design first approach and using akka-http(scala) 2.4.1. For the design-first, IMHO, swagger is widely used. I couldn't find any boilerplate implementation as to how swagger works with akka-http. How could I…
Phani
  • 1,851
  • 2
  • 15
  • 28
4
votes
1 answer

Akka-http process HttpRequests from different connections in one flow

Akka-http documentation says: Apart from regarding a socket bound on the server-side as a Source[IncomingConnection] and each connection as a Source[HttpRequest] with a Sink[HttpResponse] Assume we get the merged source containing incoming…
d-n-ust
  • 122
  • 1
  • 9
4
votes
3 answers

akka-http error: could not find implicit value for parameter um: akka.http.scaladsl.unmarshalling.FromRequestUnmarshaller

I know that has been asked already, but I can't seem to find an answer. Here is my code : import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport import spray.json.DefaultJsonProtocol final case class Client(clientId:Int,…
Sergey Malov
  • 71
  • 1
  • 1
  • 6
4
votes
1 answer

akka-http send continuous chunked http response (stream)

I have this crude test example with akka-http client and server. Server.scala: import akka.actor.ActorSystem import akka.stream.ActorMaterializer import akka.stream.scaladsl.Sink import akka.http.scaladsl.Http import…
Caballero
  • 11,546
  • 22
  • 103
  • 163
4
votes
2 answers

Akka-http: How to get custom header from a request?

I send following headers in a request to my akka-http api: "Content-type": "application/json", "Accept": "application/json", "AppId": "some_id". How do I get "AppId" custom header in my akka-http route? (get & parameters("id")) { (id) => …
user3024710
  • 515
  • 1
  • 6
  • 15
3
votes
2 answers

java.lang.NoSuchMethodError: 'void akka.actor.ExtensionId.$init$(akka.actor.ExtensionId)'

I am simply trying to implement a little sample REST endpoint in a scala project using akka. The code looks as follows import akka.http.scaladsl.Http import akka.http.scaladsl.model.{ContentTypes, HttpEntity} import…
3
votes
1 answer

How to set Bearer token in akka-htpp client request

I’m receiving a warning from akka http when trying to make a POST request with a bearer token. Here is the snippet where I am making the request. val bearerToken: String = "..." val resp = Http(context.system) .singleRequest( …
mattmar10
  • 515
  • 1
  • 4
  • 16