Akka Http [Java] Client Connection timeout after idle 60 seconds

776 views
Skip to first unread message

Wolfie

unread,
Jan 25, 2017, 4:04:44 PM1/25/17
to Akka User List

I have a long-running source which can pause for periods of several minutes during message emission. I then use this in akka http to post to a spring service. However if any pause reaches one minute the http post times-out and completes the post with code 200. I have tried all the config parameters suggested in the documentation but they are having no effect,

 

akka.http.server.idle-timeout=120s
akka.http.client.idle-timeout=120s
akka.http.host-connection-pool.idle-timeout=120s
akka.http.host-connection-pool.client.idle-timeout=120s

 

similar to this issue (https://github.com/akka/akka/issues/16597). My code looks like this:

 

Http httpContext =

    Http.get(context().system());

 

Source<ByteString, NotUsed> chunked =

    mysource.map(str -> ByteString(str.concat("\n")))

        .concat(Source.single(ByteString.empty()));

 

HttpRequest post = HttpRequest.POST("http://some-server/address")

    .withEntity(HttpEntities.createChunked(ContentTypes.APPLICATION_OCTET_STREAM, chunked))

    .withProtocol(HttpProtoclas.HTTP_1_1);

 

CompletionStage<HttpResponse> result =

    httpContext.singleRequest(post, materializer);

 

Using 10.0.2. This is a show stopper for us, can anyone help?

Konrad Malawski

unread,
Jan 25, 2017, 4:10:59 PM1/25/17
to akka...@googlegroups.com, Wolfie
The timeout configuration very certainly works. I have verified it recently.

Please make sure you're not doing something else weird that causes the config not be loaded.
The ActorSystem can log the effective configuration, please print it and look if it has the values you're expecting.

-- 
Konrad `ktoso` Malawski
Akka @ Lightbend
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Wolfie

unread,
Jan 25, 2017, 5:46:46 PM1/25/17
to Akka User List, wol...@twowolves.co.uk
Thanks for verifying. I have setup ActorSystem to log all config parameters and it is definitely receiving the adjusted values from the properties file.

Konrad Malawski

unread,
Jan 25, 2017, 5:51:22 PM1/25/17
to akka...@googlegroups.com, Wolfie
You need to share more information if you want to get help, so far I'd be unable to guess whats missing or wrong.
 
What's the exact logs, are you really sure it gets the config, have you double checked the config values?
Do you have a reproducer etc? As I mentioned, I checked this recently and it works as expected.

-- 
Konrad `ktoso` Malawski
Akka @ Lightbend

Reply all
Reply to author
Forward
0 new messages