Skip to content

Commit

Permalink
#791 revised defaults and logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Donald Oakes committed Jan 7, 2020
1 parent 5b2ef80 commit 720f8e9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/_docs/guides/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ title: MDW Configuration
fallback:
stagger: 60 # seconds offset between scheduling scan for each activity - default=30
max: 20 # maximum number of activity instances to trigger per cycle - default=100
age: 1200 # minimum age of waiting activity instances to process - default=600
age: 1200 # minimum age in seconds of waiting activity instances to process - default=600
timer.wait.fallback.enabled: true # enable fallback processing for timer wait activities - default=false
dependencies.wait.fallback.enabled: true # enable fallback processing for dependencies waits - default=false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ public int getStagger() {
* Max batch size per check cycle. From property "mdw.wait.fallback.max", with default of 1000.
*/
public int getMaxActivities() {
return PropertyManager.getIntegerProperty(PropertyNames.MDW_WAIT_FALLBACK_MAX, 1000);
return PropertyManager.getIntegerProperty(PropertyNames.MDW_WAIT_FALLBACK_MAX, 100);
}

/**
* Min age for activity to be processed (in seconds).
* From property "mdw.wait.fallback.age", with default of 300.
*/
public int getMinActivityAge() {
return PropertyManager.getIntegerProperty(PropertyNames.MDW_WAIT_FALLBACK_AGE, 300);
return PropertyManager.getIntegerProperty(PropertyNames.MDW_WAIT_FALLBACK_AGE, 600);
}

private Map<Activity,ScheduledFuture> activitySchedules = new HashMap<>();
Expand All @@ -111,12 +111,18 @@ final public void onStartup() throws StartupException {
ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1, new FallbackThreadFactory(activity));
ScheduledFuture schedule = scheduler.scheduleAtFixedRate(() -> {
try {
for (ActivityInstance activityInstance : getActivityInstances(activity)) {
List<ActivityInstance> activityInstances = getActivityInstances(activity);
String msg = "Found " + activityInstances.size() + " waiting instances of " + getActivityLabel(activity);
if (activityInstances.isEmpty())
logger.debug(msg);
else
logger.info(msg);
for (ActivityInstance activityInstance : activityInstances) {
try {
process(activity, activityInstance);
}
catch (Exception ex) {
String msg = "Processing failed for " + getActivityLabel(activity);
msg = "Processing failed for " + getActivityLabel(activity);
logger.error(msg, ex);
ActivityLogger.persist(activityInstance.getProcessInstanceId(), activityInstance.getId(), LogLevel.ERROR, msg, ex);
}
Expand Down

0 comments on commit 720f8e9

Please sign in to comment.