Skip to content

Commit

Permalink
feat: scheduled starting and stopping of message processing
Browse files Browse the repository at this point in the history
  • Loading branch information
MLenterman committed Jul 12, 2024
1 parent b88bf2b commit 23ab683
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
sidebar_position: 19
---

# Scheduled Start/Stop WorkflowSelector Receiver
The processing of messages can be started or stopped by a scheduled job. This is done by starting/stopping the receiver of the **_WorkflowSelector_**. This still allows for messages to be delivered from the **_Notificaties API_**, but they won't be processed until the receiver is turned back on. The scheduled starting/stopping of the receiver can be useful if backend services are not available during a set period of time, for example during a backup cycle. By default this scheduled job is not enabled.

### Configure Schedule
The scheduled start- and stop job for the **_WorkflowSelector_** can be configured with:
```ini
openforms2bpel.workflows.workflow-selector.start-receiver.cron-expression=0 * 5 * * ?
openforms2bpel.workflows.workflow-selector.start-receiver.enabled=false
openforms2bpel.workflows.workflow-selector.stop-receiver.cron-expression=0 * 0 * * ?
openforms2bpel.workflows.workflow-selector.stop-receiver.enabled=false
```

For information on the Quartz Cron syntax and list of examples, visit the [Quartz Scheduler Cron Trigger Documentation](https://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html).
2 changes: 2 additions & 0 deletions src/main/configurations/bpel/Configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<!ENTITY ImportFromLocalFS SYSTEM "./Configuration_ImportFromLocalFS.xml">
<!ENTITY Notificaties_Subscribe SYSTEM "./Configuration_Notificaties_Subscribe.xml">
<!ENTITY RetryScheduler SYSTEM "./Configuration_RetryScheduler.xml">
<!ENTITY StartStopReceiverScheduler SYSTEM "./Configuration_StartStopReceiverScheduler.xml">
<!ENTITY UpdatePaymentCommandHandler SYSTEM "./Configuration_UpdatePaymentCommandHandler.xml">
<!ENTITY Workflow_Fallback SYSTEM "./Configuration_Workflow_Fallback.xml">
<!ENTITY Workflow_TwoWayCommunication SYSTEM "./Configuration_Workflow_TwoWayCommunication.xml">
Expand Down Expand Up @@ -46,6 +47,7 @@
&ConvertISO639Taal;
&ImportFromLocalFS;
&RetryScheduler;
&StartStopReceiverScheduler;
&Notificaties_Subscribe;
&UpdatePaymentCommandHandler;
&Workflow_Fallback;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Module xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../FrankConfig.xsd">
<Scheduler>
<IbisActionJob
name="StopReceiver_WorkflowSelector_Job"
active="${openforms2bpel.workflows.workflow-selector.stop-receiver.enabled}"
action="STOPADAPTER"
adapterName="WorkflowSelector"
configurationName="bpel"
cronExpression="${openforms2bpel.workflows.workflow-selector.stop-receiver.cron-expression}"
>
<Locker objectId="StopWorkflowSelectorReceiverScheduler-Lock" retention="1" />
</IbisActionJob>
<IbisActionJob
name="StartReceiver_WorkflowSelector_Job"
active="${openforms2bpel.workflows.workflow-selector.start-receiver.enabled}"
action="STARTADAPTER"
adapterName="WorkflowSelector"
configurationName="bpel"
cronExpression="${openforms2bpel.workflows.workflow-selector.start-receiver.cron-expression}"
>
<Locker objectId="StartWorkflowSelectorReceiverScheduler-Lock" retention="1" />
</IbisActionJob>
</Scheduler>
</Module>
4 changes: 4 additions & 0 deletions src/main/resources/DeploymentSpecifics.properties
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ openforms2bpel.workflows.send-no-reply-user-email.auto-retry.cron-expression=${o
openforms2bpel.workflows.send-no-reply-user-email.auto-retry.max-retries=${openforms2bpel.workflows.auto-retry.max-retries}
openforms2bpel.workflows.send-no-reply-user-email.auto-retry.enabled=${openforms2bpel.workflows.auto-retry.enabled}

openforms2bpel.workflows.workflow-selector.start-receiver.cron-expression=0 * 5 * * ?
openforms2bpel.workflows.workflow-selector.start-receiver.enabled=false
openforms2bpel.workflows.workflow-selector.stop-receiver.cron-expression=0 * 0 * * ?
openforms2bpel.workflows.workflow-selector.stop-receiver.enabled=false

openforms2bpel.workflows.formdata-collector-stylesheet-file=bpel/Common/xsl/FormDataCollector_ObjectsApi_Default.xslt
openforms2bpel.workflows.formdata-transform-stylesheet-file=bpel/Common/xsl/FormDataTransform_Default.xslt
Expand Down

0 comments on commit 23ab683

Please sign in to comment.