This is a feature of Oracle File and FTP Adapters that uses an invoke activity within a
while loop to process the target file. This feature enables you to process arbitrarily
large files.
To achieve this follow the steps below.
1)Create File/FTP Adapter and select the operation type as "SynchRead"
2)Select the sample directory name and file name for incoming files
3)Select the message schema as a native
4)Click on Finish.
5)Now edit the .jca file as below
6) Now create an invoke activity and create partner link to the created File Adapter.
Now your file Adapter will be ready to read in chunks.
Now we need to put this invoke in while loop and check for end of the file by using following properties.
By setting following properties in invoke activity
while loop to process the target file. This feature enables you to process arbitrarily
large files.
To achieve this follow the steps below.
1)Create File/FTP Adapter and select the operation type as "SynchRead"
2)Select the sample directory name and file name for incoming files
3)Select the message schema as a native
4)Click on Finish.
5)Now edit the .jca file as below
<interaction-spec className="oracle.tip.adapter.file.outbound.ChunkedInteractionSpec">
<property name="DeleteFile" value="true"/>
<property name="PhysicalDirectory" value="/temp"/>
<property name="FileName" value="dummy.txt"/>
<property name="ChunkSize" value="10"/>
</interaction-spec>
6) Now create an invoke activity and create partner link to the created File Adapter.
Now your file Adapter will be ready to read in chunks.
Now we need to put this invoke in while loop and check for end of the file by using following properties.
By setting following properties in invoke activity
From Side
<bpelx:fromProperties>
<bpelx:fromProperty name="jca.file.LineNumber" variable="<Variable>"/> (Returns Line Number)
<bpelx:fromProperty name="jca.file.ColumnNumber" variable="<Variable>"/>(returnColumnNumber)
<bpelx:fromProperty name="jca.file.IsEOF" variable="<Variable>"/>(returnIs End Of the File)
<bpelx:fromProperty name="jca.file.IsMessageRejected" variable="<Variable>"/>(returnIs Message Rejected)
<bpelx:fromProperty name="jca.file.RejectionReason" variable="<Variable>"/>(returnRejectionReason)
<bpelx:fromProperty name="jca.file.NoDataFound" variable="<variable>"/>(returnNoDataFound)
</bpelx:fromProperties>
Thanks for the post Murthy - need some help to implment this.
ReplyDeletesynch read has input and output variables, what do we assign to Input variable of the invoke activity? details and sample code would be very helpful. thank you
No Need to assign any values to invoke input and output variables.just create the variables to avoid compilation errors.Instead of assigning values use required invoke properties in toside and fromside.
DeleteHi Ramana,
ReplyDeletefinally i find a good artical to process big files. But i have a question-- what do you mean by "toside" and "fromside". please elaborate this......
Thanks,
rakesh.k
Hi Rajesh,
DeleteCheck invoke activity properties.you can define properties either from or to."from" is nothing but you will get the values from service."to" is nothing but you can send values to the service.
Thanks for the post Murthy.
ReplyDeletejust a question here, can we do the same with ftp read operation (not sync read). if yes, where do we set the invoke properties.
thanks in advance,
Vikas
Use "Synchronous Get File" operation of FTP adapter and follow the same steps as used for File adapter chunk read.It should work
DeleteI am not able to use it from FTP adapter because the className="oracle.tip.adapter.ftp.outbound.ChunkedInteractionSpec" is not available in the Adapter.rar. I believe this is only valid in File Adapter
DeleteThis is not working for me for some reason :(
ReplyDeleteI have given the chunk size as 1... But it reads the entire file.
Obviously it reads the entire file but of chunk size 1.May I know,what r u doing after reading each chunk?
DeleteHi, I have configured the adapter as above but its not deleting the file after successful reading using he Sync read Option. Can you pls. guide what can be the reason or how can delete be achieved in Sync Read.
ReplyDeleteAny Sample Example ?
ReplyDeleteThese properties do not appear to exist for the FTP adapter
ReplyDeletedid you find any alternative to read the file in chunks by using FTP Adapter .. please let me know
Delete