# Akka HTTP

**URL:** https://discuss.akka.io/c/akka/akka-http/12.md

[Latest](https://discuss.akka.io/latest.md) · [Categories](https://discuss.akka.io/categories.md) · [Tags](https://discuss.akka.io/tags.md)

---

## [Akka HTTP 10.1.5 / 10.0.14 Security Fix Released](https://discuss.akka.io/t/akka-http-10-1-5-10-0-14-security-fix-released/2118)

<div class="topic-metadata">

**Author:** [@jrudolph](https://discuss.akka.io/u/jrudolph)\
**Replies:** 0\
**Last updated:** [September 13, 2018, 10:22am UTC](https://discuss.akka.io/t/akka-http-10-1-5-10-0-14-security-fix-released/2118 "2018-09-13T10:22:45Z")

</div>

Dear hakkers, we are happy to announce the 10.1.5 and 10.0.14 releases of Akka HTTP. Both releases fix the DoS vulnerability in the decodeRequest directive that was announced \[last week\] (https://akka.io/blog/news/2018/…

---

## [About the Akka HTTP category](https://discuss.akka.io/t/about-the-akka-http-category/24)

<div class="topic-metadata">

**Author:** [@ktoso](https://discuss.akka.io/u/ktoso)\
**Replies:** 0

</div>

Discuss anything related to Akka HTTP, the reactive HTTP server built on top of Akka Streams. Please don’t cross-post to stackoverflow or other forums etc. without mentioning.

---

## [What does "StreamTcpException: The connection actor has terminated. Stopping now." mean?](https://discuss.akka.io/t/what-does-streamtcpexception-the-connection-actor-has-terminated-stopping-now-mean/10836)

<div class="topic-metadata">

**Author:** [@djjorjinho](https://discuss.akka.io/u/djjorjinho)\
**Replies:** 2\
**Last updated:** [August 2, 2024, 4:36pm UTC](https://discuss.akka.io/t/what-does-streamtcpexception-the-connection-actor-has-terminated-stopping-now-mean/10836 "2024-08-02T16:36:37Z")

</div>

Hi folks, I maintain an akka-cluster–sharding service that reads events from an sqs queue, and performs external requests to about 4 other services for validation, aggregation, etc and keeps all of that in memory and pub…

---

## [Replace the response with some value](https://discuss.akka.io/t/replace-the-response-with-some-value/6588)

<div class="topic-metadata">

**Author:** [@venkatesh](https://discuss.akka.io/u/venkatesh)\
**Replies:** 0\
**Last updated:** [May 25, 2020, 5:38pm UTC](https://discuss.akka.io/t/replace-the-response-with-some-value/6588 "2020-05-25T17:38:24Z")

</div>

Hi Team, Can someone please help here? I wanted to replace the response content with some value. Here is my code def someRoute: Route = path(“ci” / “anomaly” / “detection” / “location” / Segment / Segment / “units” / I…

---

## [pathPrefix with PathMatcher greater than 2](https://discuss.akka.io/t/pathprefix-with-pathmatcher-greater-than-2/6600)

<div class="topic-metadata">

**Author:** [@dleacock](https://discuss.akka.io/u/dleacock)\
**Replies:** 0\
**Last updated:** [May 26, 2020, 9:27pm UTC](https://discuss.akka.io/t/pathprefix-with-pathmatcher-greater-than-2/6600 "2020-05-26T21:27:08Z")

</div>

I noticed that the PathMatchers directive goes up 22 number of potential match classes, but the pathPrefix only accepts up to PathMatchers2\<T, T\>. Is this by design?

---

## [java.lang.IllegalStateException Sink.asPublisher(fanout = false) only supports one subscriber](https://discuss.akka.io/t/java-lang-illegalstateexception-sink-aspublisher-fanout-false-only-supports-one-subscriber/10789)

<div class="topic-metadata">

**Author:** [@BillOTei](https://discuss.akka.io/u/BillOTei)\
**Replies:** 5\
**Last updated:** [July 8, 2024, 7:28am UTC](https://discuss.akka.io/t/java-lang-illegalstateexception-sink-aspublisher-fanout-false-only-supports-one-subscriber/10789 "2024-07-08T07:28:09Z")

</div>

We sometimes encounter the error randomly under load. With our Play Framework REST API, we have mainly blocking db IO. The majority of the requests come through a custom body parser private val streamParser: BodyParse…

---

## [Proper Akka websocket client to receive infinite incoming stream](https://discuss.akka.io/t/proper-akka-websocket-client-to-receive-infinite-incoming-stream/10692)

<div class="topic-metadata">

**Author:** [@\_Alex](https://discuss.akka.io/u/_Alex)\
**Replies:** 5\
**Last updated:** [April 8, 2024, 8:16am UTC](https://discuss.akka.io/t/proper-akka-websocket-client-to-receive-infinite-incoming-stream/10692 "2024-04-08T08:16:47Z")

</div>

I’m trying to connect to WebSocket incoming infinite stream as described here. I see only couple of messages \[info\] ----------------------- \[info\] 2024-03-28T22:20:57.023+08:00 \[info\] TextMessage.Strict({"topic":"orderb…

---

## [Need help in understanding a websocket error with Akka HTTP 10.5.2 and Scala 3](https://discuss.akka.io/t/need-help-in-understanding-a-websocket-error-with-akka-http-10-5-2-and-scala-3/10494)

<div class="topic-metadata">

**Author:** [@zhenhao](https://discuss.akka.io/u/zhenhao)\
**Replies:** 2\
**Last updated:** [October 14, 2023, 2:43pm UTC](https://discuss.akka.io/t/need-help-in-understanding-a-websocket-error-with-akka-http-10-5-2-and-scala-3/10494 "2023-10-14T14:43:03Z")

</div>

I got the following runtime exception. But I can’t see where Predef$.require is used in Handshake. Any tips? java.lang.IllegalArgumentException: requirement failed: Tried to choose invalid subprotocol ‘Some(json)’ whic…

---

## [Getting file descriptor associated with socket connection](https://discuss.akka.io/t/getting-file-descriptor-associated-with-socket-connection/10455)

<div class="topic-metadata">

**Author:** [@happy2bee](https://discuss.akka.io/u/happy2bee)\
**Replies:** 0\
**Last updated:** [August 26, 2023, 2:45am UTC](https://discuss.akka.io/t/getting-file-descriptor-associated-with-socket-connection/10455 "2023-08-26T02:45:53Z")

</div>

Hello, I have a specific use case. I’m using Akka server to handle REST APIs calls. I need to get the file descriptor associated with socket connection then pass it to some legacy C program. Is it possible to get file …

---

## [Host-connection-pool.min-connections property with positive value](https://discuss.akka.io/t/host-connection-pool-min-connections-property-with-positive-value/10439)

<div class="topic-metadata">

**Author:** [@waagnermann](https://discuss.akka.io/u/waagnermann)\
**Replies:** 1\
**Last updated:** [August 15, 2023, 7:51am UTC](https://discuss.akka.io/t/host-connection-pool-min-connections-property-with-positive-value/10439 "2023-08-15T07:51:37Z")

</div>

Here is the quote from docs of akka-http configurartion: If the number of connections is falling below the given threshold, new ones are being spawned. My question is connections with WHO are spawned at the moment of …

---

## [AKKA library in android studio Koltin project](https://discuss.akka.io/t/akka-library-in-android-studio-koltin-project/10255)

<div class="topic-metadata">

**Author:** [@vazand](https://discuss.akka.io/u/vazand)\
**Replies:** 4\
**Last updated:** [June 3, 2023, 4:01am UTC](https://discuss.akka.io/t/akka-library-in-android-studio-koltin-project/10255 "2023-06-03T04:01:37Z")

</div>

Hello friends, I am new to AKKA, and I want some examples of how to use the Akka library in the android studio project. I just want to use the AKKA library instead of Retrofit. is it possible? please share your knowledg…

---

## [Share a client connection pool across the cluster](https://discuss.akka.io/t/share-a-client-connection-pool-across-the-cluster/10203)

<div class="topic-metadata">

**Author:** [@rsmidt](https://discuss.akka.io/u/rsmidt)\
**Replies:** 1\
**Last updated:** [March 2, 2023, 9:33am UTC](https://discuss.akka.io/t/share-a-client-connection-pool-across-the-cluster/10203 "2023-03-02T09:33:09Z")

</div>

Hi, We are using ClusterSharding for our deployment and are now trying to integrate AkkaHttp Client into it. First we thought of using the CachedHostConnectionPool but it seems like it opens a pool for every node in the…

---

## [Akka Http TStream errorakka.stream.StreamTcpException: Tcp command \[Connect(xyzurl:80,None,List(),Some(10 seconds),true)\] failed](https://discuss.akka.io/t/akka-http-tstream-errorakka-stream-streamtcpexception-tcp-command-connect-xyzurl-80-none-list-some-10-seconds-true-failed/4359)

<div class="topic-metadata">

**Author:** [@ashishsahuGitHub](https://discuss.akka.io/u/ashishsahuGitHub)\
**Replies:** 2\
**Last updated:** [February 10, 2023, 1:30pm UTC](https://discuss.akka.io/t/akka-http-tstream-errorakka-stream-streamtcpexception-tcp-command-connect-xyzurl-80-none-list-some-10-seconds-true-failed/4359 "2023-02-10T13:30:56Z")

</div>

Hi , I am facing below issue in Akka http akka\_actor=‘2.4.16’, akka\_http=‘10.1.8’, akka\_stream=‘2.5.22’. And I have given the below settings val orig = ConnectionPoolSettings(actorSystem.settings.config).copy(idleTimeo…

---

## [Custom parsing error format](https://discuss.akka.io/t/custom-parsing-error-format/5027)

<div class="topic-metadata">

**Author:** [@Lazu13](https://discuss.akka.io/u/Lazu13)\
**Replies:** 1\
**Last updated:** [January 2, 2023, 10:01am UTC](https://discuss.akka.io/t/custom-parsing-error-format/5027 "2023-01-02T10:01:54Z")

</div>

Hello, I was wondering if there is any chance to customize response from Http -\> HttpServerBluePrint. Currently for any parsing related (p.e URI too long) error it returns error’s status code with some default code’s me…

---

## [Akka HTTP Resource representation 406 - Fix resource representation to \`application/json\`](https://discuss.akka.io/t/akka-http-resource-representation-406-fix-resource-representation-to-application-json/10090)

<div class="topic-metadata">

**Author:** [@mudassir](https://discuss.akka.io/u/mudassir)\
**Replies:** 0\
**Last updated:** [November 29, 2022, 8:52am UTC](https://discuss.akka.io/t/akka-http-resource-representation-406-fix-resource-representation-to-application-json/10090 "2022-11-29T08:52:40Z")

</div>

Hello, I’m new to Akka, I’d like some help in setting up a route that returns application/json whether request contains Accept header with a different type or not, I want to return json in any and all cases for that rou…

---

## [Is there a configuration option for akka http to use HSTS as a default header?](https://discuss.akka.io/t/is-there-a-configuration-option-for-akka-http-to-use-hsts-as-a-default-header/9929)

<div class="topic-metadata">

**Author:** [@martijnhoekstra](https://discuss.akka.io/u/martijnhoekstra)\
**Replies:** 1\
**Last updated:** [September 8, 2022, 2:46pm UTC](https://discuss.akka.io/t/is-there-a-configuration-option-for-akka-http-to-use-hsts-as-a-default-header/9929 "2022-09-08T14:46:22Z")

</div>

I’m using Snowplow, which is built on top of akka-http, and I’m looking at options to get the server to return hsts headers. All akka-http configuration is passed on to akka by the application, so the road of least resi…

---

## [Akka HTTP 10.2.10 released](https://discuss.akka.io/t/akka-http-10-2-10-released/9944)

<div class="topic-metadata">

**Author:** [@johanandren](https://discuss.akka.io/u/johanandren)\
**Replies:** 0\
**Last updated:** [September 6, 2022, 2:55pm UTC](https://discuss.akka.io/t/akka-http-10-2-10-released/9944 "2022-09-06T14:55:10Z")

</div>

Dear hakkers, We are happy to announce the 10.2.10 release of Akka HTTP. This release contains a few smaller improvements and bugfixes. Noteworthy changes since 10.2.9 Avoid loop in JavaQuery.render(HttpCharset, CharP…

---

## [Akka-HTTP server HTTPS Support](https://discuss.akka.io/t/akka-http-server-https-support/6082)

<div class="topic-metadata">

**Author:** [@archie\_by](https://discuss.akka.io/u/archie_by)\
**Replies:** 3\
**Last updated:** [July 24, 2022, 10:51pm UTC](https://discuss.akka.io/t/akka-http-server-https-support/6082 "2022-07-24T22:51:10Z")

</div>

I found myself struggling to enable https support for our akka-http java application. The documentation page (https://doc.akka.io/docs/akka-http/current/server-side/server-https-support.html) should be helping, but for s…

---

## [How to set BearerToken in Akka Http Client single request](https://discuss.akka.io/t/how-to-set-bearertoken-in-akka-http-client-single-request/9687)

<div class="topic-metadata">

**Author:** [@mattmar10](https://discuss.akka.io/u/mattmar10)\
**Replies:** 3\
**Last updated:** [April 15, 2022, 12:46pm UTC](https://discuss.akka.io/t/how-to-set-bearertoken-in-akka-http-client-single-request/9687 "2022-04-15T12:46:44Z")

</div>

Hi all, 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.syste…

---

## [Websocket Reconnect/Retry - Is it Possible](https://discuss.akka.io/t/websocket-reconnect-retry-is-it-possible/9676)

<div class="topic-metadata">

**Author:** [@mattmar10](https://discuss.akka.io/u/mattmar10)\
**Replies:** 2\
**Last updated:** [April 7, 2022, 9:00pm UTC](https://discuss.akka.io/t/websocket-reconnect-retry-is-it-possible/9676 "2022-04-07T21:00:11Z")

</div>

Hi all, I’m getting started with akka http websockets (from the client side), and I’ve encountered a scenario where the websocket opens and data flows… until it doesn’t. I’m not sure why but occasionally the websocket t…

---

## [One2OneBidiFlow $ OutputTruncationException on GET Request](https://discuss.akka.io/t/one2onebidiflow-outputtruncationexception-on-get-request/9622)

<div class="topic-metadata">

**Author:** [@pranavkapoorr](https://discuss.akka.io/u/pranavkapoorr)\
**Replies:** 1\
**Last updated:** [March 24, 2022, 4:06am UTC](https://discuss.akka.io/t/one2onebidiflow-outputtruncationexception-on-get-request/9622 "2022-03-24T04:06:52Z")

</div>

@jrudolph I am getting the same exception. I will put the snippet below: \` public HttpResponse handleRequest(HttpRequest request) throws InterruptedException,ExecutionException{ if (request.getUri().path().equals("/he…

---

## [Optional fileUpload](https://discuss.akka.io/t/optional-fileupload/9568)

<div class="topic-metadata">

**Author:** [@arvkonstantin](https://discuss.akka.io/u/arvkonstantin)\
**Replies:** 1\
**Last updated:** [March 22, 2022, 10:47am UTC](https://discuss.akka.io/t/optional-fileupload/9568 "2022-03-22T10:47:15Z")

</div>

Hello! A form comes to me from the frontend, in which there are fields and a file (s). My steps are like this: formFields("name") { (name) =\> fileUpload("photo") { …

---

## [Akka HTTP 10.2.9 Released](https://discuss.akka.io/t/akka-http-10-2-9-released/9577)

<div class="topic-metadata">

**Author:** [@jrudolph](https://discuss.akka.io/u/jrudolph)\
**Replies:** 0\
**Last updated:** [March 3, 2022, 4:53pm UTC](https://discuss.akka.io/t/akka-http-10-2-9-released/9577 "2022-03-03T16:53:42Z")

</div>

Dear hakkers, We are happy to announce the 10.2.9 release of Akka HTTP. This release is a bugfix release fixing a few regressions introduced with 10.2.8: Avoid memory leak when HTTP/2 is enabled (#4047) Revert the def…

---

## [Akka HTTP Client failing OAuth 1.0 Auth header call](https://discuss.akka.io/t/akka-http-client-failing-oauth-1-0-auth-header-call/9552)

<div class="topic-metadata">

**Author:** [@pranavkapoorr](https://discuss.akka.io/u/pranavkapoorr)\
**Replies:** 3\
**Last updated:** [February 25, 2022, 3:01am UTC](https://discuss.akka.io/t/akka-http-client-failing-oauth-1-0-auth-header-call/9552 "2022-02-25T03:01:38Z")

</div>

I understand there is no implementation for oAuth 1.0 inbuilt with akka so I used MasterCard Api which created OAuth String to be used as header. I used it with Java HttpsURLConnection client, OkHttp3 and it worked perfe…

---

## [Akka-Http : Timeout Client Connection if it's take more than 1s](https://discuss.akka.io/t/akka-http-timeout-client-connection-if-its-take-more-than-1s/9531)

<div class="topic-metadata">

**Author:** [@saurabhhack123](https://discuss.akka.io/u/saurabhhack123)\
**Replies:** 0\
**Last updated:** [February 17, 2022, 1:49pm UTC](https://discuss.akka.io/t/akka-http-timeout-client-connection-if-its-take-more-than-1s/9531 "2022-02-17T13:49:11Z")

</div>

We are using akka-http and below is our config , How I can timeout http client connection after 1sec ? I tried using connecting-timeout , but it’s not working . Any suggestions ? FYI: I’m already passing system config …

---

## [Akka HTTP 10.2.8 Released](https://discuss.akka.io/t/akka-http-10-2-8-released/9522)

<div class="topic-metadata">

**Author:** [@jrudolph](https://discuss.akka.io/u/jrudolph)\
**Replies:** 0\
**Last updated:** [February 14, 2022, 3:33pm UTC](https://discuss.akka.io/t/akka-http-10-2-8-released/9522 "2022-02-14T15:33:42Z")

</div>

Dear hakkers, We are happy to announce the 10.2.8 release of Akka HTTP. This release is a maintenance release, mostly fixing a few smaller issues around HTTP/2 support. Akka HTTP now also supports graceful termination …

---

## [Akka http2 upgrade does not work, throws IllegalArgumentException "Cannot pull port twice"](https://discuss.akka.io/t/akka-http2-upgrade-does-not-work-throws-illegalargumentexception-cannot-pull-port-twice/9318)

<div class="topic-metadata">

**Author:** [@gust](https://discuss.akka.io/u/gust)\
**Replies:** 1\
**Last updated:** [January 21, 2022, 9:16pm UTC](https://discuss.akka.io/t/akka-http2-upgrade-does-not-work-throws-illegalargumentexception-cannot-pull-port-twice/9318 "2022-01-21T21:16:11Z")

</div>

Hello, in our akka.http server, I try to enable http2 support with config akka.http.server.preview.enable-http2 = on. I test the connection upgrade with curl by sending curl.exe -v http://localhost:9831 --http2 \* Tr…

---

## [Max-open-requests and natural back-pressure](https://discuss.akka.io/t/max-open-requests-and-natural-back-pressure/9424)

<div class="topic-metadata">

**Author:** [@t3hnar](https://discuss.akka.io/u/t3hnar)\
**Replies:** 0\
**Last updated:** [January 18, 2022, 1:17pm UTC](https://discuss.akka.io/t/max-open-requests-and-natural-back-pressure/9424 "2022-01-18T13:17:05Z")

</div>

Hello guys, here goes pseudo code just to give background about composition I have at hand. Source .queue(…) .via { Http().newHostConnectionPool(…) } .toMat(Sink.ignore)(Keep.left) …

---

## [discardEntityBytes and "Pending: Automatic discarding of not used entities"](https://discuss.akka.io/t/discardentitybytes-and-pending-automatic-discarding-of-not-used-entities/9410)

<div class="topic-metadata">

**Author:** [@nickfun](https://discuss.akka.io/u/nickfun)\
**Replies:** 0\
**Last updated:** [January 13, 2022, 6:27pm UTC](https://discuss.akka.io/t/discardentitybytes-and-pending-automatic-discarding-of-not-used-entities/9410 "2022-01-13T18:27:05Z")

</div>

Docs page: Implications of the streaming nature of Request/Response Entities I’m trying to understand if discardEntityBytes still needs to be called on http responses? The bottom of the doc has “pending automatic discar…

---

## [Source.future vs Source.futureSource](https://discuss.akka.io/t/source-future-vs-source-futuresource/9330)

<div class="topic-metadata">

**Author:** [@kstokoz](https://discuss.akka.io/u/kstokoz)\
**Replies:** 1\
**Last updated:** [December 23, 2021, 3:45pm UTC](https://discuss.akka.io/t/source-future-vs-source-futuresource/9330 "2021-12-23T15:45:47Z")

</div>

Hi Akka Team, I\`m wondering which option is a better one to get source from future of http response: val httpResponse: Future\[HttpResponse\] = ??? Source.future(httpResponse).flatMapConcat(\_.entity.…

[Next page](https://discuss.akka.io/c/akka/akka-http/12.md?page=1)
