Howto change the Retry Cycle Time value without process re-deployment

1,786 views
Skip to first unread message

hba...@gmail.com

unread,
Feb 12, 2014, 10:49:43 AM2/12/14
to camunda-...@googlegroups.com
Hello,
is it possible to change the Retry Cycle Time value of Service Tasks without the need to redeploy the process. Maybe in combination with Spring Properties?

Many regards,
Hermann

Daniel Meyer

unread,
Feb 12, 2014, 12:51:47 PM2/12/14
to camunda-...@googlegroups.com, hba...@gmail.com
Hi Hermann,

you can change it locally (on a single cluster node) using internal API (by modifying the activity in the ProcessDefinition Graph).

You need to write a custom command, get your hands on the DeploymentCache, get the processDefinition form the Deployment Cache, 
find the ActivityImpl corresponding to your service task and modify the property

activity.setProperty(FoxFailedJobParseListener.FOX_FAILED_JOB_CONFIGURATION, someNewValue);

To sum up: no, this is not really possible. 

Maybe you can give us some insight on your usecase? Why do you want to modify it? 

Cheers,
Daniel Meyer

hba...@gmail.com

unread,
Feb 14, 2014, 2:49:59 PM2/14/14
to camunda-...@googlegroups.com, hba...@gmail.com
Hello Daniel,
thank's for your answer and your question. Here are some additional background informations:

* we use the camunda jars inside of a Spring, RESTEasy web service
* application server is tomcat
* our new process contains 5 asynchronous ServiceTasks, each send a request to a backend service
* in generall our backend services are very fast, high available and our customers should get the process output as fast as possible (< 1 sec.) – we use the asynchronous feature (with retries) so that each service call is made and to handle the rare technical error cases
* our IT staff (without special BPMN/camunda know how) is always available to resolve critical situations. Softwaredeveloper are only on working days between 9.00 and 17.00 available
* our IT needs a simple way to controll the number of requests. This is necessary to reduce the number of service requests in critical heavy load situations

I'm now searching for a good solution to fulfill our IT requirement. My first thougths (without knowing how much work is involved for the realization) are:
* maby we could make the number of job executor threads configurable?
* maby we could make the job execution time interval configurable?
* maby we could use the Retry Time Cycle (initial configuration: R2160/PT2M) and make the value for each service configurable for our IT? After max. 3 days a software developer /operations manager could restart the process manual via camunda REST API.

I am looking forward about your feedback. Also since i am not very happy with my solutions listed above.

Many regards,
Hermann

Daniel Meyer

unread,
Feb 19, 2014, 9:54:08 AM2/19/14
to camunda-...@googlegroups.com, hba...@gmail.com
Hi Hermann,

thanks for the clarification. Maybe the solution would be to support expression language for configuring the Retry Time Cycle. This would allow you to resolve the retry time cycle using a Spring / CDI / EJB bean or something like that which could read it from a configuration source.

WDYT?

Cheers,
Daniel Meyer


hba...@gmail.com

unread,
Feb 23, 2014, 2:44:31 PM2/23/14
to camunda-...@googlegroups.com, hba...@gmail.com
Hallo Daniel,
that sounds good for me :-)

Currently we use the Spring property placeholder to load the engine configuration properties:

<context:property-placeholder location="classpath*:config/application.properties" />

<context:component-scan base-package="org.camunda.bpm.example.loanapproval" />

We could add the Retry Time Cycle values to the existing property file, e.g.:

calculateInterestServiceTask.retryTimeCycle=R4/PT1M

As far as i know the property placeholder could inject the property values only at application context startup time. If your proposed solution is similar to the already existing Spring Bean – Service Task expression language solution (e.g. implemendet in ServiceTaskDelegateExpressionActivityBehavior – execute(...) - Object delegate = expression.getValue(execution);), it's possible to add a property holder bean in the application, e.g.:

@Named
public class RetryTimeCyclePropertyHolder {

private final String calculateInterestServiceTaskValue;

@Inject
public RetryTimeCyclePropertyHolder(
@Value("${calculateInterestServiceTask.retryTimeCycle}") final String calculateInterestServiceTaskValue) {
this.calculateInterestServiceTaskValue = calculateInterestServiceTaskValue;
}

public String getCalculateInterestServiceTaskValue() {
return calculateInterestServiceTaskValue;
}
}

If you're interested, i could try to implement this feature with a little help from you in a camunda branch. Or do you think it is better to implement a custom JobRetryCmd class?

Many regards,
Hermann

hba...@gmail.com

unread,
Feb 24, 2014, 9:05:44 AM2/24/14
to camunda-...@googlegroups.com, hba...@gmail.com
Hello,
it is also possible to use:

<util:properties id="camundaSettings" location="classpath:config/camunda.properties" />

which creates a java.util.properties bean containing all the properties.

The property values could be read e.g. via:

ExpressionParser parser = new SpelExpressionParser();
StandardEvaluationContext context = new StandardEvaluationContext();
context.setBeanResolver(new BeanFactoryResolver(applicationContext));

Expression expression =
parser.parseExpression("@camundaSettings['calculateInterestServiceTask.retryTimeCycle']");
final String value = expression.getValue(context, String.class);

Many regards,
Hermann

Halil

unread,
Jun 24, 2014, 2:54:15 PM6/24/14
to camunda-...@googlegroups.com, hba...@gmail.com
Hi Daniel,

is this feature already implemented.

We have a similar use case as described above by Hermann and want to modify the failedJobRetryTimeCycle dynamically.

Thanks beforehand.

Best regards
Halil
Reply all
Reply to author
Forward
0 new messages