AnsweredAssumed Answered

Rejected job handler (JobExecutor / AsyncExecutor)

Question asked by tatitone on Dec 2, 2015

Before I used the version 5.16.3 of Activiti. I need the asynchronous service task (activiti:async=true) so I used the jobExecutor to do this.
To manage the rejected job, I have implemented the interface org.activiti.engine.impl.jobexecutor.RejectedJobsHandler (see the class below MyRejectedJobHandler) and I have configured  the jobExcutor to use this implementation (see the spring configuration below).

<code lang="java" >
public class MyRejectedJobHandler implements RejectedJobsHandler {
   private static final Logger LOGGER = LoggerFactory.getLogger(MyRejectedJobHandler .class);
   public void jobsRejected(JobExecutor jobExecutor, List<String> jobIds) {
      LOGGER.error("Rejected jobs {}", jobIds );

<code lang="html">
<bean id="rejectedJobsHandler" class="MyRejectedJobHandler "/>
<bean id="myJobExecutor" class="org.activiti.engine.impl.jobexecutor.DefaultJobExecutor">
     <property name="rejectedJobsHandler" ref="rejectedJobsHandler"/>

Now I have upgraded the Activiti : version 5.18.0. I use the AsyncExecutor instead of the JobExecutor.
In the class AsyncExecutor (or DefaultAsyncJobExecutor), there is not the property "rejectedJobsHandler".
Question :
  • With the AsyncExecutor is it possible to have "rejected job" : acquired a job but cannot be executed (for example because the queue-size exceeded). If yes, please could you tell me how to manage the rejected job with the AsyncExecutor ?
Best Regards