In some cases a user wants to allow for the time difference between when a task is requested and when the infrastructure actually launches it. Spring Cloud Task allows a user to create a TaskExecution at the time the task is requested. Then pass the execution ID of the generated TaskExecution to the task so that it can update the TaskExecution through the task’s lifecycle.
The TaskExecution can be created by calling the createTaskExecution
method on
an implementation of the TaskRepository that references the datastore storing
the TaskExecutions.
In order to configure your Task to use a generated TaskExecutionId add the following property:
spring.cloud.task.executionid=<yourtaskId>