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

How do i use Akka java circuit breaker with CompletableFutures?

I am using Play! 2.5 (Java) and Akka. Here's my problem: I am trying to call an external service using WSClient and would like it to be behind a Akka circuit breaker. The code I have shown below doesn't seem to work as expected. I would expect the…
jesukumar
  • 1,139
  • 9
  • 19
0
votes
1 answer

ToResponseMarshaller in Akka http

I am using akka http. In my API layer I have defined the following classes: sealed abstract class ApiResponse[A](val content: A, val code: Int) final case class Success[A](override val content: A, override val code: Int) extends…
user3763116
  • 235
  • 1
  • 2
  • 11
0
votes
1 answer

POST param validation in Akka HTTP

Is it possible to validate the POST body in Akka Http? Case Class Validationseems to work only for get requests. As an example: case class User(name: String){ require(name) } ..... (post & entity(as[User])) { user => …
EugeneMi
  • 3,475
  • 3
  • 38
  • 57
0
votes
0 answers

Akka HTTP does not handle ValidationRejections, instead throws require java.lang.IllegalArgumentException: requirement failed

I have the following test "adding a nominee with empty fields " should { "be rejected" in { val nominee = NomineeReq("Saving", "", "***", "29-08-1984", "Friend", "***", Some("***"), "1234", "****", "Some state", Some("****")) …
EugeneMi
  • 3,475
  • 3
  • 38
  • 57
0
votes
1 answer

Client POST of indeterminate length to a server

[Java DSL] I'm trying to post a stream of bytes to a server (as the body) using the client api in real-time but won't know the length prior to the start of the request. I can't figure out how to do this from the akka-http documentation, has anyone…
Oakdale
  • 138
  • 1
  • 7
0
votes
0 answers

Akka HTTP doesn't render collection when using custom ToEntityMarshaller

I have defined a custom ToEntityMarshaller for type Organisation. When requesting localhost:8080/organisations it return an empty JSON array. Only when I remove the implicit def organisationMarshaller: ToEntityMarshaller[Organisation] it return the…
Sebastian
  • 16,813
  • 4
  • 49
  • 56
0
votes
1 answer

Akka routing DSL not matching expected routes

here are three routes I am trying to match /games/2016/1 /games/2016 /games and I'm trying to do so with this routing structure: pathPrefix("games") { logger.info("INSIDE GAMES PATH KEY ") path(PathEnd) { complete("no numbers") } ~…
Chris Stewart
  • 1,641
  • 2
  • 28
  • 60
0
votes
1 answer

Spray and akka-http throughput decreased significantly on response length change

I benchmark spray and akka-http to be aware of possible throughput I can get. Tested application is simple. It returns static output on static GET path. But in case of both frameworks I get throughput decreased from ~64000 to ~22000 rps when static…
Olga Gorun
  • 327
  • 3
  • 13
0
votes
1 answer

"Lifting" A Scala Function into an HttpRequest Processor

I'm looking for some way of converting a function which takes basic parameter types and using it to process an akka HttpRequest. I want the Path to be automatically processed and passed to the function. As an example, given some function def…
Ramón J Romero y Vigil
  • 17,373
  • 7
  • 77
  • 125
0
votes
1 answer

Akka Http Error: InvalidContentLengthException

We have an Akka HTTP Server serving some scala JS content on AWS. We've noticed that after some time, the server starts throwing the error below in the logs and although, the certain URL's work, but some files fail to be downloaded correctly with…
MojoJojo
  • 3,897
  • 4
  • 28
  • 54
0
votes
1 answer

found : akka.http.scaladsl.server.StandardRoute [error] required: scala.util.Try

I am new to Scala and to akka i am trying to publish endpoint. Following compilation error is occurring. found: akka.http.scaladsl.server.StandardRoute [error] required: scala.util.Try[Option[com.activegrid.entities.AuthSettings]] =>…
Siva Kumar
  • 632
  • 3
  • 9
  • 19
0
votes
1 answer

Chaining together akka stream flows that each make HTTP requests

I have a restful blog server (http://jsonplaceholder.typicode.com) that responds to these two URIs /posts/{id} : get a blog post by ID /comments?postId={id} : get all the comments on a blog by the blog's id Starting with a batch of blog…
bigh_29
  • 2,529
  • 26
  • 22
0
votes
1 answer

Generic JSON Support

How do you use RootJsonFormat with Generics? Do I have to copy paste every possibility like this: trait IDJsonSupport extends SprayJsonSupport with DefaultJsonProtocol{ implicit object AddressIDFormat extends RootJsonFormat[ID[Address]] { …
Etam
  • 4,553
  • 10
  • 40
  • 60
0
votes
1 answer

Moving WebSocket from Play to Akka HTTP

I have a WebSocket server in a Play app, and I want to move it to an akka-http service. I'm currently using ActorFlow.actorRef, which is a part of Play that doesn't exist in Akka. When the WebSocket is accepted, I subscribe to a RabbitMQ queue, and…
Isvara
  • 3,403
  • 1
  • 28
  • 42
0
votes
1 answer

Perform tasks in the correct order in Scala and Akka without blocking

I have microservice that works with Couchbase. My service must ask Couchbase how many documents I have with the current id: if the number is low, I create another document. My problem is that this is non-blocking: if I have a lot of requests when I…