0
votes

Using Akka http with a simple get returning a future from Slick DAO does only gives a timeout response 503 service unavailable when the future actually completes, whereas it should just give a 503 response after timeout expires.

Below is the configuration in application.conf

include "akka-http-version"
akka.http {
   server {
     idle-timeout = 300 s
     request-timeout = 2 s
   }
}

If, with above configuration a request comes and repository takes, let's say 10 seconds then the response only after 10 seconds is 503, whereas we should get a 503 after 2 seconds itself.

1
I’m voting to close this question because there is no question being asked - Levi Ramsey

1 Answers

0
votes

The Akka behaviour works perfectly fine. The timeout has to happen on the Future thread (different thread of an async operation).

The main thread which starts at the beginning of the route must not be blocked for Akka to reply with a 503, the timeout must happen on the async thread.