cancel
Showing results for 
Search instead for 
Did you mean: 

asyncExecutorAsyncJobLockTimeInMillis resets to 5 minutes when I override to custom time

sarveshmvm
Confirmed Champ
Confirmed Champ

Hello all,

I am noticing the below issue sporadically in my application . I am using springboot with activiti 6. 

We have long running Jobs in each of the service tasks which could last upto 1-2 hour. Since I have like 20+ processes , I did not follow segregating the external calls to signal the User task as I end up in  creating big process workflow. I was overriding the asyncExecutorAsyncJobLockTimeInMillis  from 5 minutes to my custom time (say 3 hours ). I noticed that some of the process steps were getting picked by Async job twice or more. When I tried to trace the history of ACT_RU_JOB , I see for some steps the lock expiry time is set to 5 minutes. What could have caused this issue?

Bean that sets the custom  Lock Expiry Time:

@bean
public SpringAsyncExecutor springAsyncExecutor () {

SpringAsyncExecutor asyncExecutor = new SpringAsyncExecutor();
asyncExecutor.setTimerLockTimeInMillis(config.getMaximumProcessingTime()); // 12 hours
asyncExecutor.setAsyncJobLockTimeInMillis(config.getMaximumProcessingTime()); // 12 hours
return asyncExecutor;
}

Also In addition to that I set it at engine config level as well:

@bean
public SpringProcessEngineConfiguration springProcessEngineConfiguration(
@Qualifier("activitiTxMnger") PlatformTransactionManager transactionManager,
@Qualifier("springAsyncExecutor") SpringAsyncExecutor springAsyncExecutor) throws IOException {

SpringProcessEngineConfiguration engineConfig = baseSpringProcessEngineConfiguration(
activitiDataSource(),
transactionManager,
springAsyncExecutor);

engineConfig.setAsyncExecutorNumberOfRetries(0);
engineConfig.setAsyncExecutorTimerLockTimeInMillis(config.getMaximumProcessingTime()); //12 hours
engineConfig.setAsyncExecutorAsyncJobLockTimeInMillis(config.getMaximumProcessingTime()); // 12 hours
engineConfig.setAsyncExecutorActivate(true);
engineConfig.setDatabaseSchemaUpdate("true");
engineConfig.setHistory(HistoryLevel.AUDIT.getKey());

return engineConfig;
}

Any help is appreciated!!

Thanks

0 REPLIES 0