5
Debatching : When a file contains multiple messages, you can select to publish messages in a specific number of batches. This is referred to as debatching. During debatching, the file reader, upon restart, proceeds from where it left off in the previous run, thereby avoiding duplicate messages. Files greater than or equal to 7 MB cannot be delivered. As an alternative, you can debatch large files (if they have multiple messages), and publish these files in messages of sizes less than 7 MB. This alternative option is applicable only to structured files (comma-delimited or fixed position), which contain more than one message. It is not applicable to binary or XML files. File Polling The frequency with which to poll the inbound directory for new files to retrieve. The minimum file age of files to retrieve. For example, this enables a large file to be completely copied into the directory before it is retrieved for processing. The age is determined by the last modified time stamp. For example, if you know that it takes three to four minutes for a file to be written, set the minimum age of pollable files to five minutes. If a file is detected in the input directory and its modification time is less than 5 minutes older than the current time, the file is not retrieved because it is still potentially being written to. Whether or not to delete files after a successful retrieval. If this check box is not selected, processed files remain in the inbound directory, but are ignored. Only files with modification dates more recent than the last processed file are retrieved. If you place another file in the inbound directory with the same name as a file that has already been processed, but the modification date remains the same, that file is not retrieved. File Processing The file adapter prepares the files for processing and delivers them to the adapter translator for translation and debatching (if necessary). If you have many inbound files to process or very large files of more than 1 MB, you may need to increase the config timeout value in the Oracle_ Home\integration\orabpel\system\appserver\oc4j\j2ee\home\server. xml file: <transaction-config timeout="30000"/>

File Adapter Note

Embed Size (px)

DESCRIPTION

File Adapter Note

Citation preview

Page 1: File Adapter Note

Debatching : When a file contains multiple messages, you can select to publish messages in a specific number of batches. This is referred to as debatching. During debatching, the file reader, upon restart, proceeds from where it left off in the previous run, thereby avoiding duplicate messages.

Files greater than or equal to 7 MB cannot be delivered. As an alternative, you can debatch large files (if they have multiple messages), and publish these files in messages of sizes less than 7 MB. This alternative option is applicable only to structured files (comma-delimited or fixed position), which contain more than one message. It is not applicable to binary or XML files.

File PollingThe frequency with which to poll the inbound directory for new files to retrieve.■ The minimum file age of files to retrieve. For example, this enables a large file to be completely copied into the directory before it is retrieved for processing. The age is determined by the last modified time stamp. For example, if you know that it takes three to four minutes for a file to be written, set the minimum age of pollable files to five minutes. If a file is detected in the input directory and its modification time is less than 5 minutes older than the current time, the file is not retrieved because it is still potentially being written to.■ Whether or not to delete files after a successful retrieval. If this check box is not selected, processed files remain in the inbound directory, but are ignored. Only files with modification dates more recent than the last processed file are retrieved. If you place another file in the inbound directory with the same name as a file that has already been processed, but the modification date remains the same, that file is not retrieved.

File ProcessingThe file adapter prepares the files for processing and delivers them to the adaptertranslator for translation and debatching (if necessary).If you have many inbound files to process or very large files of more than 1 MB, youmay need to increase the config timeout value in the Oracle_Home\integration\orabpel\system\appserver\oc4j\j2ee\home\server.xml file:<transaction-config timeout="30000"/>

Native Data TranslationIf native format translation is not required (for example, a JPG or GIF image is being processed) select the Native format translation is not required check box. The file is passed through in base-64 encoding. XSD files are required for translation. If you want to define a new schema or convert an existing data type description (DTD) or COBOL Copybook, select Define Schema for Native Format. This starts the Native Format Builder Wizard. This wizard guides you through the creation of a native schema file from file formats such as comma-separated value (CSV), fixed-length, DTD, and COBOL Copybook. After the native schema file is created, you are returned to this Messages window with the Schema File URL and Schema Element fields filled in. Ensure that the schema you specify includes a namespace. If your schema does not have a namespace, an error message appears.

Page 2: File Adapter Note

Error HandlingThe file adapter provides several inbound error handling capabilities:■ rejectedMessageHandlers Property■ fatalErrorFailoverProcess Property■ uniqueMessageSeparator Property■ Default Error Directory

rejectedMessageHandlers PropertyYou can configure your BPEL process to process the correct records of a file and write only the rejected records to an archive directory by setting the rejectedMessageHandlers property. For example, assume that you have a file with four records. If three records are processed successfully and one record is not, the file is processed with the three correct records. The record that errored is written to a rejected messages directory. The behavior of the rejectedMessageHandlers property in case a file has only one message is to reject the entire message.

You first define the rejectedMessageHandlers property as an activationAgentproperty in the bpel.xml file so that it applies to inbound WSDL operations only:<BPELSuitcase><BPELProcess src="ErrorTest.bpel" id="ErrorTest"><activationAgents><activationAgentclassName="oracle.tip.adapter.fw.agent.jca.JCAActivationAgent"partnerLink="inboundPL"><property name="rejectedMessageHandlers">file://C:/orabpel/samples/test/errorTest/rejectedMessages</property>This causes messages that error to be written to the configured directory using thefollowing naming pattern:INVALID_MSG_ + process-name + operation-name + current-time

fatalErrorFailoverProcess PropertyIf the file adapter (or any OracleAS Adapter) encounters an unrecoverable systemerror (such as no more memory or a full disk), it can instruct the adapter framework toshut down the BPEL process.You can optionally configure a standby (or failover) BPEL process to be invoked whenthe adapter initiates the shutdown request of the (main) BPEL process.You configure this failover BPEL process by setting thefatalErrorFailoverProcess property as an activationAgent property in thebpel.xml file.<property name="fatalErrorFailoverProcess">bpel://bpel-domain:password|process-name|operation-name|input-message-part-name</property>where password (which can be omitted if it is bpel) can be encrypted.For example:<property name="fatalErrorFailoverProcess">bpel://default|JCA-FatalErrorHandler|handleError|message</property>or

Page 3: File Adapter Note

<property name="fatalErrorFailoverProcess">bpel://default:C23487CFA591952D3ED0B81F0961F65A|JCA-FatalErrorHandler|handleError|message</property>where the bpel password was specified in encrypted form (using the encrypt.bat(for Windows) or encrypt.sh (for UNIX) command line utility).The fatal error BPEL process must use a specific input (WSDL) message type. Thismessage type is defined in the system-provided WSDL fileFatalErrorMessageWSDL.wsdl. This WSDL can be referenced (imported) usingthe following:

<import namespace="http://xmlns.oracle.com/pcbpel/fatalErrorHandler"location="http://localhost:9700/orabpel/xmllib/jca/FatalErrorMessage.wsdl"/>

The XML schema type for this message is as follows:<complexType name="FatalErrorMessageType"><sequence><element name="Reason" type="string"/><element name="Exception" type="string"/><element name="StackTrace" type="string"/></sequence></complexType>The purpose of the failover BPEL process can be to undertake error compensatingactions, alert someone through e-mail or short message service (SMS), or restart someother process.

uniqueMessageSeparator PropertyIn the case of debatching (multiple messages in a single file), the typical behavior is to reject the messages from the first bad message to the end of the file. If each message has a unique separator and that separator is not part of any data, then rejection can be more fine-grained. In these cases, you can define a uniqueMessageSeparator in the schema element of the native schema to have the value of this unique message separator. This property controls how the adapter translator works when parsing through multiple records in one file (debatching). This property enables recovery even when detecting bad messages inside a large batch file; when a bad record is detected, the adapter translator skips to the next unique message separator boundary and continues from there. If you do not set this property, all records that follow the record that errored are also rejected.

The following schema file provides an example of using uniqueMessageSeparator.<?xml version="1.0" ?><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"targetNamespace="http://TargetNamespace.com/Reader"xmlns:tns="http://TargetNamespace.com/Reader"elementFormDefault="qualified" attributeFormDefault="unqualified"nxsd:encoding="US-ASCII" nxsd:stream="chars"nxsd:version="NXSD" nxsd:uniqueMessageSeparator="${eol}"><xsd:element name="emp-listing"><xsd:complexType><xsd:sequence><xsd:element name="emp" minOccurs="1" maxOccurs="unbounded"><xsd:complexType><xsd:sequence><xsd:element name="GUID" type="xsd:string" nxsd:style="terminated"nxsd:terminatedBy="," nxsd:quotedBy="&quot;"></xsd:element><xsd:element name="Designation" type="xsd:string"nxsd:style="terminated" nxsd:terminatedBy=","nxsd:quotedBy="&quot;"></xsd:element>

Page 4: File Adapter Note

<xsd:element name="Car" type="xsd:string" nxsd:style="terminated"nxsd:terminatedBy="," nxsd:quotedBy="&quot;"></xsd:element><xsd:element name="Labtop" type="xsd:string"nxsd:style="terminated" nxsd:terminatedBy=","nxsd:quotedBy="&quot;"></xsd:element><xsd:element name="Location" type="xsd:string"nxsd:style="terminated" nxsd:terminatedBy=","nxsd:quotedBy="&quot;"></xsd:element></xsd:sequence></xsd:complexType></xsd:element></xsd:sequence></xsd:complexType></xsd:element></xsd:schema><!--NXSDWIZ:D:\work\jDevProjects\Temp_BPEL_process\Sample2\note.txt:--><!--USE-HEADER:false:-->

https://asksoa.wordpress.com/file-adapter-error-handling/https://community.oracle.com/thread/991438?start=0&tstart=0

Default Error DirectoryIf you do not set the rejectedMessageHandlers property, records that error duringtranslation are placed by default inOracle_Home\integration\orabpel\domains\domain_name\archive\jca\default_directory