Saturday, April 4, 2009

How to Read Files Ordered by Timestamp with FTP and FILE Adapter ?

Here is metalink note for this.
Subject:
How to Read Files Ordered by Timestamp with FTP and FILE Adapter ?

Doc ID:
779136.1
Type:
HOWTO

Modified Date :
02-MAR-2009
Status:
PUBLISHED
In this Document Goal Solution References
Applies to:
Oracle SOA Platform - Version: 10.1.3.3.1 to 10.1.3.4Oracle(R) BPEL Process Manager - Version: 10.1.3.3.1 to 10.1.3.4Oracle(R) BPEL Process Manager - Version: 10.1.3.3.1 to 10.1.3.4Oracle ESB - Version: 10.1.3.3.1 to 10.1.3.4Information in this document applies to any platform.
Goal
This document explains how to configure the FTP or FILE adapter in the following scenario :
1. you have several files in the Inbound directory waiting for pooling2. you want to process the files ordered by timestamp ascending or descending
Solution
There is no setting out-of-the box to do this ordering with FTP or FILE adapter. This feature was introduced from 10.1.3.3.1 MLR#14 (Patch 7253921) and 10.1.3.4 MLR#1 (Patch 7375086)
To implement it please perform following steps :
1. Model the BPEL process as a synchronous one
2. In the Inbound activation specification (the WSDL file for inbound FTP/FILE adapter) add the the following:
Sorter="oracle.tip.adapter.file.inbound.listing.TimestampSorterDescending"
OR
Sorter="oracle.tip.adapter.file.inbound.listing.TimestampSorterAscending"
This line will provide Descending or Ascending sorting of filenames.
3. If you use FTP Adapter you also need to add in Inbound activation :
useNlst="true"
This parameter tells the adapter to use LIST command to get filenames as opposed to NLST. The advantage with the LIST command is that the adapter can capture the tiemstamp, size information during the inbound listing. Below is a sample setting for FTP Adapter Inbound :

4. Edit file SOA_HOME\bpel\system\services\config\pc.properties and change
oracle.tip.adapter.file.numProcessorThreads=1
If you use ESB you need to edit file SOA_HOME\integration\esb\config\pc.properties (rename pc.properties.esb to pc.properties if you don't have this file)
References
Keywords
TIMESTAMP ; INBOUND