Admin.XMLBackgroundTaskConfiguration.xml
The Admin.XMLBackgroundTaskConfiguration.xml file contains the data that enables the handling and processing of background tasks.
Changelog
| File version | Content Manager version | Notes |
|---|---|---|
| 1.0 | 11.0.0 | n/a |
| 1.1 | 11.0.1 | Introducing IBackgroundTaskHandler, an extra handler .NET element to configure handlers in .NET. |
Introduction
The background task configuration is accessible from the Content Manager Web Client using
- Service definitions with all information for a specific service role.
- Handler definitions with the configuration for handling background tasks.
Service definition
- Overview
-
Each service definition is identified by its role (e.g. Default).
The service definition specifies which of the following components the service is executing:- The poller component tries to get the next background task which can be executed by this service. The background tasks which can be polled are specified in the availability matrix.
- The leaseRecovery component searches for background tasks which (probably) have failed because they are blocked/leased longer than the expected execution time extended with the grace period.
- The aggregationRecovery component processes aggregations which failed during the synchronous processing
- XML elements
-
Name Description service Contains the service definition service @role Identifies the behavior of the service matrix Contains the availability matrix which specifies for every group of event types the maximum number of parallel executions group Groups event types which have similar execution requirements group @name The name of the group group @maxExecutions The maximum number of parallel executions for this group handlers Contains the references to the handlers within this group add The reference to the handler with a specific event type add @ref The name of the event type which needs to match with the eventType of one of the handler definitions leaseRecovery Contains the configuration for the lease recovery leaseRecovery @isEnabled Specifies if the current service will do any lease recovery leaseRecovery @interval Contains a time (in TimeSpan format) indicating how long the service will wait before searching for another blocked background task. poller Contains the configuration for the poller poller @isEnabled Specifies if the current service will poll for background tasks to execute poller @interval Contains a time (in TimeSpan format) indicating how long the service will wait before searching for another background task.
aggregationRecovery Contains the configuration for the aggregation recovery aggregationRecovery @isEnabled Specifies if the current service will do any aggregation recovery aggregationRecovery @gracePeriod Specifies within which period (in TimeSpan format) the synchronous execution has to finish the aggregation before the service will start the recovery aggregationRecovery @interval Contains a time (in TimeSpan format) indicating how long the service will wait before searching for another aggregation task.
aggregationRecovery @maximumRetries Specifies the maximum number of attempts for the aggregation recovery - Example
-
<service role="Default"> <matrix> <group name="Translations" maxExecutions="2"> <handlers> <add ref="CREATETRANSLATIONFROMREPORT" /> <add ref="CREATETRANSLATIONFROMLIST" /> <add ref="CREATETRANSLATION" /> <add ref="RELEASETRANSLATIONS" /> </handlers> </group> <group name="Export" maxExecutions="2"> <handlers> <add ref="EXPORTFORPUBLICATION" /> <add ref="INBOXEXPORT" /> <add ref="REPORTEXPORT" /> <add ref="SEARCHEXPORT" /> <add ref="PUBLICATIONEXPORT" /> </handlers> </group> <group name="SynchronizeToLiveContent" maxExecutions="1"> <handlers> <add ref="SYNCHRONIZETOLIVECONTENT" /> </handlers> </group> <group name="Others" maxExecutions="2"> <handlers> <add ref="THUMBNAILSUBMIT" /> <add ref="ISHBATCHIMPORT" /> </handlers> </group> </matrix> <leaseRecovery isEnabled="true" interval="00:05:00" /> <poller isEnabled="true" interval="00:00:05" /> <aggregationRecovery isEnabled="true" gracePeriod="00:10:00" interval="00:10:00" maximumRetries="3" /> </service>
Handler definition
- XML elements
-
Name Description handler Contains the handler definition. handler @eventType Defines the name of the event type. scheduler Defines the schedule for the background task. scheduler @executeSynchronously Specifies whether the background task is executed synchronously or asynchronously. authorization Specifies the authorization used for the background task. authorization @type Defines the authorization type. For all legacy COM+ IEventHandler handlers, the authorization must be "authenticationContext".execution Container for the background task execution configuration. execution @timeout Defines the timeout interval for the background task in TimeSpan format. execution @recoveryGracePeriod If the background task times out, this attribute defines the grace period interval in TimeSpan format; when the grace period expires, the service starts recovery. execution @isolationLevel Defines if the background task is executed in the same process as the service (None), in a new process (Process), or in a new AppDomain within the same process as the service (AppDomain). execution @useSingleThreadApartment Defines whether the background task must be executed with Single Thread Apartment. activator Container for the activator configuration. comIEventHandler Container for the COM+ IEventHandler activator configuration. comIEventHandler @projectName Defines the project name (e.g ISAuthorIso). comIEventHandler @className Defines the class name (e.g CTranslationMgmt). configuration Contains all required information for the background task execution. The data is passed to the handler executing the background task. net Contains the configuration for the .NET activator. net @name Specifies the handler name. parameters Contains parameters required to execute the background task. parameter Contains a value for a single parameter required to execute the background task. parameter @name Specifies the name of the parameter required to execute the background task. errorHandler Configures the error handling of the background task service which is limited to deciding if the task should be retried or not when a specific error is thrown by the background task handler. errorHandler @maximumRetries Specifies how many attempts will be executed when a background task failsactions Configures the actions during error handling add Configures the action for a specific error add @errorNumber Contains the error number add @action Specifies the action for a specific error. The possible values are - "Retry" to indicate that the background task must be retried for this error.
- "Ignore" to indicate that the background task should not be retried for this error.
add @delay Optional attribute indicating if the retry must be delayed or can be done immediately
- Example
-
<handler eventType="CREATETRANSLATIONFROMREPORT"> <scheduler executeSynchronously="false"/> <authorization type="authenticationContext"/> <execution timeout="01:00:00" recoveryGracePeriod="00:10:00" isolationLevel="None" useSingleThreadApartment="true"/> <activator> <comIEventHandler projectName="ISAuthorIso" className="CTranslationMgmt"> <configuration> <parameters> <parameter name="batchsize" type="value">1000</parameter> </parameters> </configuration> </comIEventHandler> </activator> <errorHandler maximumRetries="3"> <actions> <add errorNumber="*" action="Retry" delay="00:01:00"/> </actions> </errorHandler> </handler>
Remarks
| TimeSpan | Explanation |
|---|---|
| 00:00:05 | 5 seconds |
| 00:10:00 | 10 minutes |
| 01:00:00 | 1 hour |
| 1.00:00:00 | 24 hours or 1 day |
| 24:00:00 | 24 days (not 24 hours) |