akka.pattern.AskTimeoutException while running Lagom HelloWorld example


I have a problem while trying my hands on the Hello World example explained here.

Kindly note that I have just modified the HelloEntity.java file to be able to return something other than “Hello, World!”. Most certain my changes are taking time and hence I am getting the below Timeout error. I am currently trying (doing a PoC) on a single node to understand the Lagom framework and do not have liberty to deploy multiple nodes.

I have also tried modifying the default lagom.circuit-breaker in application.conf “call-timeout = 100s” however, this does not seem to have helped.

Following is the exact error message for your reference:

{“name”:“akka.pattern.AskTimeoutException: Ask timed out on [Actor[akka://hello-impl-application/system/sharding/HelloEntity#1074448247]] after [5000 ms]. Sender[null] sent message of type “com.lightbend.lagom.javadsl.persistence.CommandEnvelope”.”,“detail”:“akka.pattern.AskTimeoutException: Ask timed out on [Actor[akka://hello-impl-application/system/sharding/HelloEntity#1074448247]] after [5000 ms]. Sender[null] sent message of type “com.lightbend.lagom.javadsl.persistence.CommandEnvelope”.\n\tat akka.pattern.PromiseActorRef$.$anonfun$defaultOnTimeout$1(AskSupport.scala:595)\n\tat akka.pattern.PromiseActorRef$.$anonfun$apply$1(AskSupport.scala:605)\n\tat akka.actor.Scheduler$$anon$4.run(Scheduler.scala:140)\n\tat scala.concurrent.Future$InternalCallbackExecutor$.unbatchedExecute(Future.scala:866)\n\tat scala.concurrent.BatchingExecutor.execute(BatchingExecutor.scala:109)\n\tat scala.concurrent.BatchingExecutor.execute$(BatchingExecutor.scala:103)\n\tat scala.concurrent.Future$InternalCallbackExecutor$.execute(Future.scala:864)\n\tat akka.actor.LightArrayRevolverScheduler$TaskHolder.executeTask(LightArrayRevolverScheduler.scala:328)\n\tat akka.actor.LightArrayRevolverScheduler$$anon$4.executeBucket$1(LightArrayRevolverScheduler.scala:279)\n\tat akka.actor.LightArrayRevolverScheduler$$anon$4.nextTick(LightArrayRevolverScheduler.scala:283)\n\tat akka.actor.LightArrayRevolverScheduler$$anon$4.run(LightArrayRevolverScheduler.scala:235)\n\tat java.lang.Thread.run(Thread.java:748)\n”}

Question: Is there a way to increase the akka Timeout by modifying the application.conf or any of the java source files in the Hello World project? Can you please help me with the exact details.
Thanks in advance for you time and help.


Hi Aseem,

the call to a PersistentEntity doesn’t use circuit breakers so your settings is not being used on this case.
What you are looking for is lagom.persistence.ask-timeout which defaults to 5s.


Thanks for your reply.
Could you please provide details on how to set lagom.persistence.ask-timeout parameter? Do I have to set this value in application.conf or any of the java source files in the Hello World project?

Thanks in advance.

Thanks @ignasi35 for the help/pointer.
Adding following lines to resources/application.conf did the trick for me:

hello {

call-timeout = 30s


However, not really sure what is the relation/difference between the lagom.persistence.ask-timeout & call-timeout.

That’s a good question indeed. :smiley:

A Call is a Service-to-Service communication. That’s a SeviceClient communicating to a remote server. It uses a circuit breaker. It is a extra-service call.

An ask (in the context of lagom.persistence) is sending a command to a persistent entity. That happens across the nodes insied your Lagom service. It is not using circuit breaking. It is an intra-service call.


1 Like

Thanks @ignasi35 for the clarification. :-)