Error Handling in Record Transfer Mode

Error Handling provides a convenient way of analyzing the parsing errors in Record Transfer mode.

Note: When IO errors occur, Publication Service exits; Subscription Service does not confirm messages and exits by default. When you set the adfiles.io.sub.exit4issue property to OFF, Subscription Service confirms messages and continues to process other messages regardless of the IO errors.

Publication Service

When Publication Service detects a parsing error that violates the predefined schema, an XML file containing the name of the input file and the error details is created. To use this feature, you must specify a valid directory in the Error Directory field in the Processing tab.

For example: If a read schema is defined as follows:
H
  D
where H and D are delimited file records (identified by a constant) with the following fields and types:
H
field_1 String (Header)
field_2 ui4
D
field_1 String (Detail)
field_2 ui4
For example, if Publication Service parses an input.txt input file, which contains the following records:
Header, -10
Detail, 20
Header, 30
Detail, 40
Header, 50
Detail, 60
The line Header -10 fails in validation. The XML file created is named input.txt20030917151048000.xml.
<?xml version="1.0" encoding="UTF-8" ?>
- <file name="input.txt20030917151048000">
- <errorObjects>
- <object>
<contents>Header, -10 </contents>
<location startLine="1" endLine="1" startOffset="0"
endOffset="11" />
<error>Header record contains invalid data field: Header, -10
[-10]</error>
</object>
</errorObjects>

The XML file contains the name of the input file and an object element for each error. Each object element contains details such as the entire identified object, location of the object in the file, and error details. The input file that has parsing errors is kept for analysis. The location and name depend on the postprocessing option specified in the Processing tab. If the input file is abc.txt, the following list describes the name and location based on various postprocessing options that are available:

  • Leave as is
    • abc.txt is retained in the input directory
    • abc.txt.timestamp is created in the error directory
    • abc.txt.timestamp.xml is created in the error directory
  • Delete
    • abc.txt is deleted from the input directory
    • abc.txt.timestamp is created in the error directory
    • abc.txt.timestamp.xml is created in the error directory
  • Move to (without timestamp)
    • abc.txt is moved to the done directory
    • abc.txt.timestamp.xml is created in the error directory
    • no copy of the input file is created in the error directory
Note: For easy identification, the timestamp on the XML file and the corresponding input file is the same.

Subscription Service

If an error occurs when processing a file transfer, one of the following scenarios might occur to Subscription Service:
  • If an error occurs when Subscription Service is writing a file in the wip directory, Subscription Service does not confirm the message, it prints an error log and exits by default. When you set the adfiles.io.sub.exit4issue property to OFF, Subscription Service prints an error log, confirms the message, and then continues to receive other messages.
  • If an error occurs when Subscription Service is moving the transfer file from the working directory to the output directory, and the error directory is specified, the adapter moves the file to the error directory and Subscription Service exits by default. When you set the adfiles.io.sub.exit4issue property to OFF, Subscription Service does not exit.
  • When IO errors occur in Subscription Service, Subscription Service exits by default. If Publication Service continues to send messages using the Durable EMS transport or the Certified RV transport, Subscription Service resubscribes the remaining messages from the transport when restarted.
Note: To save messages on the Certified RV transport, you have to select Repeating in the Life Cycle field in Publication Service.

When an IO error occurs, whether the data format of a message is Business document (MBusinessDocument) or Object (MInstance), Subscription Service handles the IO error in the same way.