Query on async job types

Hi all,

I would like to know the difference bet the below mentioned job types and in which case the type of the async job will be “message”

image

Best Regards,
Sriram

Hi Sriram,

Use custom queries:

or create a pull request which extends job query.

Regards
Martin

Hi @martin.grofcik ,

Sorry i couldn’t get you. I just need to understand the difference between each job types since i am facing an issue. Let me explain you my use case.

The below is a voting process which i am using and it has sub voting within it.

As part of completing the sub-voting process, i am getting the below error with jobs. Could you pls let me know your thoughts on this.

> [2022-11-28T16:48:48.048 IST] [org.flowable.common.engine.impl.interceptor.CommandContext] [125] [ERROR] [flowable-async-job-executor-thread-1] Error while closing command context
> java.lang.NullPointerException: null
> 	at org.flowable.engine.impl.util.CountingEntityUtil.isExecutionRelatedEntityCountEnabled(CountingEntityUtil.java:116)
> 	at org.flowable.engine.impl.cfg.DefaultInternalJobManager.handleJobDeleteInternal(DefaultInternalJobManager.java:126)
> 	at org.flowable.job.service.ScopeAwareInternalJobManager.handleJobDelete(ScopeAwareInternalJobManager.java:67)
> 	at org.flowable.job.service.impl.persistence.entity.JobEntityManagerImpl.delete(JobEntityManagerImpl.java:98)
> 	at org.flowable.job.service.impl.persistence.entity.JobEntityManagerImpl.delete(JobEntityManagerImpl.java:82)
> 	at org.flowable.job.service.impl.persistence.entity.JobEntityManagerImpl.delete(JobEntityManagerImpl.java:31)
> 	at org.flowable.job.service.impl.asyncexecutor.DefaultJobManager.executeMessageJob(DefaultJobManager.java:500)
> 	at org.flowable.job.service.impl.asyncexecutor.DefaultJobManager.execute(DefaultJobManager.java:341)
> 	at org.flowable.job.service.impl.cmd.ExecuteAsyncRunnableJobCmd.execute(ExecuteAsyncRunnableJobCmd.java:88)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker$1.run(CommandInvoker.java:67)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:140)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:114)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:72)
> 	at org.flowable.engine.impl.interceptor.BpmnOverrideContextInterceptor.execute(BpmnOverrideContextInterceptor.java:26)
> 	at org.flowable.common.engine.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:53)
> 	at org.flowable.common.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:105)
> 	at org.flowable.common.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
> 	at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)
> 	at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51)
> 	at org.flowable.job.service.impl.asyncexecutor.ExecuteAsyncRunnable.executeJob(ExecuteAsyncRunnable.java:127)
> 	at org.flowable.job.service.impl.asyncexecutor.ExecuteAsyncRunnable.run(ExecuteAsyncRunnable.java:115)
> 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
> 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
> 	at java.base/java.lang.Thread.run(Thread.java:834)
> [2022-11-28T16:48:48.048 IST] [org.flowable.job.service.impl.asyncexecutor.DefaultAsyncRunnableExecutionExceptionHandler$1] [44] [ERROR] [flowable-async-job-executor-thread-1] Job 6d3ad29c-6f0e-11ed-8728-00ff0c2cc9cb failed
> java.lang.NullPointerException: null
> 	at org.flowable.engine.impl.util.CountingEntityUtil.isExecutionRelatedEntityCountEnabled(CountingEntityUtil.java:116)
> 	at org.flowable.engine.impl.cfg.DefaultInternalJobManager.handleJobDeleteInternal(DefaultInternalJobManager.java:126)
> 	at org.flowable.job.service.ScopeAwareInternalJobManager.handleJobDelete(ScopeAwareInternalJobManager.java:67)
> 	at org.flowable.job.service.impl.persistence.entity.JobEntityManagerImpl.delete(JobEntityManagerImpl.java:98)
> 	at org.flowable.job.service.impl.persistence.entity.JobEntityManagerImpl.delete(JobEntityManagerImpl.java:82)
> 	at org.flowable.job.service.impl.persistence.entity.JobEntityManagerImpl.delete(JobEntityManagerImpl.java:31)
> 	at org.flowable.job.service.impl.asyncexecutor.DefaultJobManager.executeMessageJob(DefaultJobManager.java:500)
> 	at org.flowable.job.service.impl.asyncexecutor.DefaultJobManager.execute(DefaultJobManager.java:341)
> 	at org.flowable.job.service.impl.cmd.ExecuteAsyncRunnableJobCmd.execute(ExecuteAsyncRunnableJobCmd.java:88)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker$1.run(CommandInvoker.java:67)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:140)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:114)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:72)
> 	at org.flowable.engine.impl.interceptor.BpmnOverrideContextInterceptor.execute(BpmnOverrideContextInterceptor.java:26)
> 	at org.flowable.common.engine.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:53)
> 	at org.flowable.common.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:105)
> 	at org.flowable.common.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
> 	at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)
> 	at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51)
> 	at org.flowable.job.service.impl.asyncexecutor.ExecuteAsyncRunnable.executeJob(ExecuteAsyncRunnable.java:127)
> 	at org.flowable.job.service.impl.asyncexecutor.ExecuteAsyncRunnable.run(ExecuteAsyncRunnable.java:115)
> 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
> 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
> 	at java.base/java.lang.Thread.run(Thread.java:834)
> [2022-11-28T16:48:48.048 IST] [org.flowable.common.engine.impl.interceptor.CommandContext] [125] [ERROR] [flowable-async-job-executor-thread-1] Error while closing command context
> java.lang.NullPointerException: null
> 	at org.flowable.engine.impl.cmd.JobRetryCmd.execute(JobRetryCmd.java:105)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker$1.run(CommandInvoker.java:67)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:140)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:114)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:72)
> 	at org.flowable.engine.impl.interceptor.BpmnOverrideContextInterceptor.execute(BpmnOverrideContextInterceptor.java:26)
> 	at org.flowable.common.engine.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:53)
> 	at org.flowable.common.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:105)
> 	at org.flowable.common.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
> 	at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)
> 	at org.flowable.job.service.impl.asyncexecutor.DefaultAsyncRunnableExecutionExceptionHandler$1.execute(DefaultAsyncRunnableExecutionExceptionHandler.java:60)
> 	at org.flowable.job.service.impl.asyncexecutor.DefaultAsyncRunnableExecutionExceptionHandler$1.execute(DefaultAsyncRunnableExecutionExceptionHandler.java:37)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker$1.run(CommandInvoker.java:67)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:140)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:114)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:72)
> 	at org.flowable.engine.impl.interceptor.BpmnOverrideContextInterceptor.execute(BpmnOverrideContextInterceptor.java:26)
> 	at org.flowable.common.engine.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:53)
> 	at org.flowable.common.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:105)
> 	at org.flowable.common.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
> 	at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)
> 	at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51)
> 	at org.flowable.job.service.impl.asyncexecutor.DefaultAsyncRunnableExecutionExceptionHandler.handleException(DefaultAsyncRunnableExecutionExceptionHandler.java:37)
> 	at org.flowable.job.service.impl.asyncexecutor.ExecuteAsyncRunnable.handleFailedJob(ExecuteAsyncRunnable.java:211)
> 	at org.flowable.job.service.impl.asyncexecutor.ExecuteAsyncRunnable.executeJob(ExecuteAsyncRunnable.java:146)
> 	at org.flowable.job.service.impl.asyncexecutor.ExecuteAsyncRunnable.run(ExecuteAsyncRunnable.java:115)
> 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
> 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
> 	at java.base/java.lang.Thread.run(Thread.java:834)
> [2022-11-28T16:48:48.048 IST] [org.flowable.common.engine.impl.interceptor.CommandContext] [125] [ERROR] [flowable-async-job-executor-thread-1] Error while closing command context
> java.lang.NullPointerException: null
> 	at org.flowable.engine.impl.cmd.JobRetryCmd.execute(JobRetryCmd.java:105)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker$1.run(CommandInvoker.java:67)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:140)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:114)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:72)
> 	at org.flowable.engine.impl.interceptor.BpmnOverrideContextInterceptor.execute(BpmnOverrideContextInterceptor.java:26)
> 	at org.flowable.common.engine.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:53)
> 	at org.flowable.common.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:105)
> 	at org.flowable.common.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
> 	at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)
> 	at org.flowable.job.service.impl.asyncexecutor.DefaultAsyncRunnableExecutionExceptionHandler$1.execute(DefaultAsyncRunnableExecutionExceptionHandler.java:60)
> 	at org.flowable.job.service.impl.asyncexecutor.DefaultAsyncRunnableExecutionExceptionHandler$1.execute(DefaultAsyncRunnableExecutionExceptionHandler.java:37)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker$1.run(CommandInvoker.java:67)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:140)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:114)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:72)
> 	at org.flowable.engine.impl.interceptor.BpmnOverrideContextInterceptor.execute(BpmnOverrideContextInterceptor.java:26)
> 	at org.flowable.common.engine.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:53)
> 	at org.flowable.common.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:105)
> 	at org.flowable.common.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
> 	at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)
> 	at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51)
> 	at org.flowable.job.service.impl.asyncexecutor.DefaultAsyncRunnableExecutionExceptionHandler.handleException(DefaultAsyncRunnableExecutionExceptionHandler.java:37)
> 	at org.flowable.job.service.impl.asyncexecutor.ExecuteAsyncRunnable.handleFailedJob(ExecuteAsyncRunnable.java:211)
> 	at org.flowable.job.service.impl.asyncexecutor.ExecuteAsyncRunnable.executeJob(ExecuteAsyncRunnable.java:146)
> 	at org.flowable.job.service.impl.asyncexecutor.ExecuteAsyncRunnable.run(ExecuteAsyncRunnable.java:115)
> 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
> 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
> 	at java.base/java.lang.Thread.run(Thread.java:834)
> Exception in thread "flowable-async-job-executor-thread-1" java.lang.NullPointerException
> 	at org.flowable.engine.impl.cmd.JobRetryCmd.execute(JobRetryCmd.java:105)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker$1.run(CommandInvoker.java:67)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:140)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:114)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:72)
> 	at org.flowable.engine.impl.interceptor.BpmnOverrideContextInterceptor.execute(BpmnOverrideContextInterceptor.java:26)
> 	at org.flowable.common.engine.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:53)
> 	at org.flowable.common.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:105)
> 	at org.flowable.common.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
> 	at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)
> 	at org.flowable.job.service.impl.asyncexecutor.DefaultAsyncRunnableExecutionExceptionHandler$1.execute(DefaultAsyncRunnableExecutionExceptionHandler.java:60)
> 	at org.flowable.job.service.impl.asyncexecutor.DefaultAsyncRunnableExecutionExceptionHandler$1.execute(DefaultAsyncRunnableExecutionExceptionHandler.java:37)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker$1.run(CommandInvoker.java:67)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:140)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:114)
> 	at org.flowable.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:72)
> 	at org.flowable.engine.impl.interceptor.BpmnOverrideContextInterceptor.execute(BpmnOverrideContextInterceptor.java:26)
> 	at org.flowable.common.engine.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:53)
> 	at org.flowable.common.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:105)
> 	at org.flowable.common.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
> 	at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)
> 	at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51)
> 	at org.flowable.job.service.impl.asyncexecutor.DefaultAsyncRunnableExecutionExceptionHandler.handleException(DefaultAsyncRunnableExecutionExceptionHandler.java:37)
> 	at org.flowable.job.service.impl.asyncexecutor.ExecuteAsyncRunnable.handleFailedJob(ExecuteAsyncRunnable.java:211)
> 	at org.flowable.job.service.impl.asyncexecutor.ExecuteAsyncRunnable.executeJob(ExecuteAsyncRunnable.java:146)
> 	at org.flowable.job.service.impl.asyncexecutor.ExecuteAsyncRunnable.run(ExecuteAsyncRunnable.java:115)
> 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
> 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
> 	at java.base/java.lang.Thread.run(Thread.java:834)

Regards,
Sriram

timer → type for a timer job
message → asynchronous job
externalWorker → a job type for external workers.

When an exception happens in a job, it will be retried (by default 3 times) afterwards. Does it fail 3 times and then becomes a deadletter job or does it resolve on a next try?

Hi @joram ,

Whenever we start the application, the job is being executed but getting failed with the above mentioned error.

The job is not resolved and stays in the db. How to check whether the job became as a deadletter job ?

In my case, the jobHandlerType is "parallel-multi-instance-complete" and jobType is "message"

Either in the database (ACT_RU_DEADLETTER_JOB) or through the managementService#createDeadLetterJobQuery() API.

Does it always happen? If so - can you share your model so we can investigate?

Hi @joram ,

Let me try to explain my usecase. I have a subprocess inside a subprocess. When the internal subprocess gets completed, a job with type as “message” and handlerType as “parallel-multi-instance-complete”. Getting an Null Pointer Exception followed by which this job remains in the db and not getting deleted until we delete it manually. Whenever the executor tries to reset this job, i am getting the null pointer error. Refer the bpmn image below.

It would be helpful if you can try this case out and let me know if i am missing out something. Let me know if you need any additional details.

Thanks !

Hey @sriramb,

Please share your entire BPMN XML. Without it we are not able to try out your model.

Cheers,
Filip