Problem with failedJobRetryTimeCycle not being honored for http-connector serviceTask

595 views
Skip to first unread message

kc7b...@gmail.com

unread,
Dec 16, 2014, 9:34:18 AM12/16/14
to camunda-...@googlegroups.com
I'm having a problem getting my failedJobRetryTimeCycle to be honored for exceptions thrown by a http-connector service task. I've configured my Camunda test environment as:

<bean id="processEngineConfiguration" class="org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration">

<property name="expressionManager">
<bean class="org.camunda.bpm.engine.test.mock.MockExpressionManager"/>
</property>

<property name="processEnginePlugins">
<list>
<bean class="org.camunda.connect.plugin.impl.ConnectProcessEnginePlugin" />
<bean class="org.camunda.spin.plugin.impl.SpinProcessEnginePlugin" />
</list>
</property>

<property name="customPostBPMNParseListeners">
<list>
<bean class="org.camunda.bpm.engine.impl.bpmn.parser.FoxFailedJobParseListener" />
</list>
</property>

<property name="failedJobCommandFactory" ref="foxFailedJobCommandFactory" />

</bean>

<bean id="foxFailedJobCommandFactory" class="org.camunda.bpm.engine.impl.jobexecutor.FoxFailedJobCommandFactory" />

I've configured my serviceTask as

<bpmn2:serviceTask id="send_mir_done_service_task" name="Send MIR Done">
<bpmn2:extensionElements>
<fox:failedJobRetryTimeCycle>R10/PT10M</fox:failedJobRetryTimeCycle>
<camunda:connector>
<camunda:connectorId>http-connector</camunda:connectorId>
<camunda:inputOutput>
<camunda:inputParameter name="url">${'http://localhost:8800/AirDone/'}${air_id}${'/'}${mir_review_code}</camunda:inputParameter>
<camunda:inputParameter name="method">POST</camunda:inputParameter>

However when I run against a non-existent http server I get an exception in my test case:

org.camunda.bpm.engine.ProcessEngineException: Exception while invoking connector HTCL-02007 Unable to execute HTTP request
at org.camunda.connect.plugin.impl.ServiceTaskConnectorActivityBehavior.execute(ServiceTaskConnectorActivityBehavior.java:58)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityExecute.execute(PvmAtomicOperationActivityExecute.java:42)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityExecute.execute(PvmAtomicOperationActivityExecute.java:27)

I would have expected the fox:failedJobRetryTimeCycle to catch the error and hold the job for re-try. Am I doing something wrong? Is this the expected behavior?

One more question, is it possible to configure the http-connector to return a variable on an exception so that my BPM process can catch it and process the error rather than throwing a Technical Exception?

David

Roman Smirnov

unread,
Dec 17, 2014, 4:15:13 AM12/17/14
to camunda-...@googlegroups.com, kc7b...@gmail.com
Hi David,

The "failedJobRetryTimeCycle" will only be honored when on the service will be executed asynchronously. Therefore you have to set the attribute "async" (or "asyncBefore" - if you use camunda BPM 7.2), this looks as follows:


<bpmn2:serviceTask id="send_mir_done_service_task" name="Send MIR Done" camunda:async="true"

      <bpmn2:extensionElements> 
        <fox:failedJobRetryTimeCycle>R10/PT10M</fox:failedJobRetryTimeCycle> 
    ...
 

If the ServiceTask will be reached during the execution of the process, a new Job will created. The Job will be acquired and executed by the JobExecutor, if the execution of the job fails the "failedJobRetryTimeCycle" will be honored.

The "failedJobRetryTimeCycle" is independent from the http-connector.

Does it help you?

Cheers,
Roman
Reply all
Reply to author
Forward
0 new messages