Hi,
I am using Task Executor to run some activities in background.But i some scenario object used in TaskExecutor are not fully initialized or the values which is set in object are not loaded to when we get these values. Can we delay the task executor to only run when objects are initilazed or any other way to fix this.
@Qualifier(value = "applicationTaskExecutor")
@Autowired
private TaskExecutor taskExecutor;
taskExecutor.execute(() -> {
// code to be executed in a new thread
try{
apiService.apiAudit(submissionData.toString());
}catch (Exception e){
log.info("Exception e"+e);
e.printStackTrace();
}
});