0

In Spring Boot is there a way to pause the execution of @Async Annotated Methods at runtime until a condition is met or for a duration?

In a Spring Boot Microservice I have a REST Controller which accepts request synchronously and then calls a delegate annotated with @Async to run resource heavy jobs.

Every day the Microservice has to read large csv files and parse them, which takes about 1-2 Minutes. For this period I would like to pause the execution of the Async Method but keep the queue, so that as soon as all the reading and parsing is done, it will then continue to run the Async methods.

Ajay Kumar
  • 2,906
  • 3
  • 23
  • 46

0 Answers0