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

Why akka-http Unmarshaler returns Future[T] instead of T?

Since documentation is not ready I'll ask akka maintainers here. Why akka-http Unmarshaler returns Future[T] instead of T ? Here is my goal. I want to unmarshal class from XML http response similarly how it's done for json. For example I'd like to…
expert
  • 29,290
  • 30
  • 110
  • 214
5
votes
2 answers

How to respond with the result of an actor call?

We are looking at using Akka-HTTP Java API - using Routing DSL. It's not clear how to use the Routing functionality to respond to an HttpRequest; using an Untyped Akka Actor. For example, upon matching a Route path, how do we hand off the request to…
Piyush Jajoo
  • 1,095
  • 2
  • 18
  • 27
4
votes
0 answers

General SSLEngine problem akka http singleRequest version 10.2.3

I recently upgraded to akka http 10.2.3 and akka 2.6.11. I am using Http().singleRequest(_, httpsCtx) in my service to call API with https, here httpsCtx is https context. Before upgrading akka http, below code to create https context was working…
Abhay
  • 928
  • 1
  • 10
  • 28
4
votes
1 answer

How to add retries to POST request in akka http?

I am doing a POST request with the following akka http request side api. Http().singleRequest(....) I found that akka http for post doesn't support retries. // max-retries = 3 // AKKA http default value is 5, and it doesn't work for POST…
supernatural
  • 1,107
  • 11
  • 34
4
votes
0 answers

How to start debugging "The http server closed the connection unexpectedly before delivering responses for 1 outstanding requests"

I have turned on DEBUG level logging for my application but am not able to see anything useful for why the http server would close the connection. This exception happens within alpakka's SqsPublishSink which uses SqsAsyncClient. It doesn't appear to…
irregular
  • 1,437
  • 3
  • 20
  • 39
4
votes
0 answers

How to detect akka-http server request timeout?

When writing an HTTP server using akka-http’s high-level Route API, is there a way to be notified that the request timeout has expired, or to check whether it is expired, or to check how much time remains? In implementing an expensive route, I would…
yonran
  • 18,156
  • 8
  • 72
  • 97
4
votes
1 answer

Obtain version of Akka HTTP at run time

My server is built on top of Akka HTTP. If I don't set the Server header, the externally configurable default of akka-http/10.1.8 will be automatically added by Akka. I know how to override that with my own server by adding the respondWithHeaders…
Igor Urisman
  • 717
  • 1
  • 6
  • 22
4
votes
1 answer

How to get know, if the configuration is loaded

I am using akka http websocket client and would like to keep the client alive. On the section Automatic keep-alive Ping support it says, to put the configuration into application.conf as the following:…
softshipper
  • 32,463
  • 51
  • 192
  • 400
4
votes
2 answers

Akka Streams - Backpressure for Source.unfoldAsync

I'm currently trying to read a paginated HTTP resource. Each page is a Multipart Document and the response for the page include a next link in the headers if there is a page with more content. An automated parser can then start at the oldest page…
l7r7
  • 1,134
  • 1
  • 7
  • 23
4
votes
1 answer

Simple server-push broadcast flow with Akka

I am struggling to implement a - rather simple - Akka flow. Here is what I think I need: I have a single server and n clients and want to be able to react to external events by broadcasting messages (JSON) to the clients. The clients can…
Florian Baierl
  • 2,378
  • 3
  • 25
  • 50
4
votes
1 answer

Akka Http Parsing Entity Java

I have a code that handle incoming http requests as follows public Function < HttpRequest, HttpResponse > handleRequest() { return new Function < HttpRequest, HttpResponse > () { private static final long serialVersionUID = 1 L; …
4
votes
0 answers

Handling exceptions in akka-stream in akka-http complete function call

I'm having issues with akka-http returning an exception when a akka-stream fails while being run in a akka-http complete method. Working when running the stream before akka-http returns result. Would like to stream the result even if the stream…
Mads Fox
  • 61
  • 5
4
votes
0 answers

Error "Deflater has been closed" when logging response body with akka-http

I am using Akka-Http to make a rest server and i want to log requests and results, however I'm getting an exception whenever i try to do runReduce on the response entity. The exception says java.lang.NullPointerException: Deflater has been closed.…
Eirik Thon
  • 91
  • 5
4
votes
1 answer

Akka Http - "Type mismatch" while parsing DateTime into json

I have created simple trait which should convert models into json: trait Protocols extends SprayJsonSupport with DefaultJsonProtocol { implicit val travelFormat = jsonFormat4(Travel) } I have a Travel model which looks like: case class Travel(id:…
Developus
  • 1,400
  • 2
  • 14
  • 50
4
votes
0 answers

Akka-grpc: how to authenticate request?

Is there a way to intercept request in akka-grpc? (I need to get authentication info and enrich request with it).
Teimuraz
  • 8,795
  • 5
  • 35
  • 62