ErrorRetrieveCron
Configuration file |
./conf/sample_ErrorRetrieveCron.properties |
Class name |
com.ebd.hub.datawizard.plugin.ErrorRetrieveCron |
Description
This class provides information about failed jobs, which are currently shown in the Control Center's Errors tab. Note: If the strict client handling is active, only errors from the client on which the profile runs are returned.
With this class, users are able to create a profile, which automatically reacts to certain errors. In combination with other classes, it is possible to develop flexible solutions for a semi-automatic error treatment. This allows for the user to be relieved from routine tasks and provides a means to automatically react to regular nightly unavailability of external systems.
The class allows setting the path for an optional configuration file in the field "Configuration file".
The result is a CSV file with the two following record types.
Record type "Error" |
Master record. Occurring once per error. |
Record type "Stack" |
Optional record. May occur several times after an error record and allows a precise identification of the error by the use of the Java stack trace. |
Syntax of the record "Error"
The error record is a CSV record with record type "Error", field delimiter semicolon, and the following syntax.
<Record type>;"<Profile name>";<Profile phase of occuring error>;<Error number - relevant only internally>;<Timestamp in format yyyyMMdd HHmmss.SSS>;<Job number>;<Error text> |
Example:
Error;"temp";6;40;20130912 094146.139;335306;Error sending ... (HTTP 500)
Syntax of the record "Stack"
The stack record is a CSV record with record type "Stack", field delimiter semicolon, and the following syntax.
<Record type>;<Java stack trace line> |
Example:
Stack;at java.io.FileOutputStream.<init>(FileOutputStream.java:192)
There will be one stack record for each line in the Java stack trace. The evaluation of the stack records is usually not necessary.
Notes:
The field <Error text> of an error record may be split into 1-n fields, depending on the error description.
If the CSV fields contain values that must be quoted, the entire field is set in quotes (").
This class can, for example, be used in cooperation with the response class RestartFailedJob. The error list (with job numbers) that is produced by the ErrorRetrieveCron can be processed by a subsequent profile that we call 'management profile'. This profile can be used to further filter for specific errors, e.g. by analysing the error text or the stack traces, and will then start all the remaining jobs with response class RestartFailedJob. In addition to that, the management profile can check for availability of the destination system, e.g. with functions, to delay the restart if the destination system is not available yet.
Parameters
The configuration file may contain the following parameters.
Parameter |
Description |
cc.error.profiles |
(optional) List of profile names separated by |, or * for all profiles. Default: * |
cc.error.phase |
(optional) List of profile phases (1 to 6) separated by | , or * for all phases. Default: * |
cc.error.temp.dir |
(optional) Directory for temp files. Default: ./temp |
cc.error.onlyJobList |
(optional) If true, only the job numbers are returned and nothing else. Default: false. |
If no profile list is defined (or *), only one job for each run of the cron will be created, containing all the current errors of every profile.
If a profile list is defined, a separate job for each profile in the list is created, containing all current errors of that profile.
If no phase is defined (or *), all errors from all phases will be listed. Otherwise, only the errors of the defined phases. Allowed values are 1 to 6, other values will lead to an error.
Example
cc.error.phase=
6
cc.error.profiles=*
cc.error.temp.dir=./temp/errors-phase6/
cc.error.onlyJobList=
true