Tuesday, 29 November 2016

JCA Adapters Tips & Tricks


Oracle Fusion Middleware

JCA Adapters Tips & Tricks

In This post, I want to list important JCA adapter properties, which are really helpful in real-time projects.

Assumption: In this post, when I use a word called "CLUSTER", it contains one Admin server and two SOA Managed servers. Two Managed servers which are running, in two physical machines.

File Adapter:  

Tip1: 

If we are using File polling Adapter in clustered SOA domain then we have to use HA File adapter JNDI (eis/HAFileAdapter).
We should edit one property in HA File adapter JNDI. That is "controlDir" property in HAFile adapter JNDI as shown in below image.
image1(HA File Adapter Properties):
 
image2(HA File Adapter Properties):
If we don't configure controlDir property, then two SOA managed server will poll one file two times. To avoid duplicate file processing we have to configure controlDir property.  
We can expect same behavior and configuration for HA FTP Polling adapter.

NOTE: controlDir property value (path) should be mounted between two physical machines as shared folder.
image3(HA FTP Adapter Properties):  
 

Tip2:  

By default File Adapter will read multiple files from inbound folder in one polling. 
Actually there is no limit that how many files should be processed in one polling.
If you want to control total number of files to be processed in one polling then we have to set below two properties in JCA file (Open file polling adapter .jca file and manually we have provide these properties).
<property name="SingleThreadModel" value="true"/>
<property name="ThreadCount" value="4"/>


As per the above example, 4 threads will be created and only 4 files will be processed in one polling

FTP Adapter

Tip1: 

By default FTP polling adapter will create archive file in local folder of SOA server physical machine. If we want to archive FTP file in FTP location then we have to set below FTP adapter jca property.

NOTE: But we cant set this property in design time(jca file in JDeveloper). It is possible to set only at run time in enterprise manager(jca service adapter properties in EM).
Navigation: develop SOA project by using FTP adapter -->deploy SOA project --> login into EM --> single click on our SOA project --> scroll down dashboard tab --> click on FTP polling adapter --> properties tab -->
a. click add button -->  add new property --> "UseRemoteArchive" as "true"
b. fileArchivePath --> path should be available in FTP location.

Database Adapter:

Tip1:

In SOA Clustered environment, if we configure DB polling adapter then we have to enable singletone property in .jca file as below.If we don't configure this property then DB polling adapter(2 SOA managed servers) will try to read duplicate records from source table. 


Tip2:
Few important jca properties in DB polling adapter.
Database Rows Per XML Document: <property name="MaxRaiseSize" value="6"/>
Database Rows Per Transaction: <property name="MaxTransactionSize" value="15"/>
DB adapter will not process all records as one unit. DB adapter will debatch table into sub parts with the help of above properties.

"TABLE" will be divided into sub parts, each sub part is called as "TRANSACTIONS"
"TRANSACTION" will be divided into sub parts, each sub part is called as "XML Documents"
Each "XML Document" will be processed as one SOA instance.

If we configure above two properties in a DB polling adapter then we can expect below behaviour.
Ex: Assume, DB Table has 50 records, MaxTransactionSize set as 15 and MaxRaiseSize set as 6.
Now the way of execution is as below.

Table with 50 records will be divided into 4 transactions.
transaction1 has 15 records
transaction2 has 15 records
transaction3 has 15 records
transaction4 has 5 records (observe only 5 records in last transaction)  

Now TRANSACTIONS should be divided into XML Documents.
Transaction1 devided into 3 XML Documents.
            XML Document1 has 6 records
            XML Document2 has 6 records
            XML Document3 has 3 records (Observer only 3 records in last XML Document.)         
Transaction2 devided into 3 XML Documents.
            XML Document1 has 6 records
            XML Document2 has 6 records
            XML Document3 has 3 records (Observer only 3 records in last XML Document.) 
Transaction3 devided into 3 XML Documents.
            XML Document1 has 6 records
            XML Document2 has 6 records
            XML Document3 has 3 records (Observer only 3 records in last XML Document.)  
Transaction4 devided into 1 XML Documents.
            XML Document1 has 5 records (Observer only 1 XML Document with 5 records.)

Finally, above table will be divided into total 10 sub parts and we are calling these sub parts as XML Documents. As i mentioned above 10 XML Documents will be processed as 10 SOA instances.

NOTE: Here very important point we need to observer. All these 10 SOA instances will be processed parallel in one polling.

If you don't want to process all XML Documents in one polling then we can control processing behavior by setting below property in .jca file.
 <property name="NumberOfThreads" value="1"/>
If Value is 1, it means only one XML Document  will be processed in one polling. 10 XML Documents will be processed in 10 sequential polling's.

  
NOTE: If you like this post or if you have any unresolved jca properties, feel free to comments here.

12 comments:

  1. Nice Information Mr.Kumar, well organized and explained too.

    ReplyDelete
  2. can we write 2 files from the same ftp adapter at the same time

    ReplyDelete
  3. one of the blogs which i saw to get Clear idea on properties, please do more

    ReplyDelete
  4. Please provide more information by maintaing the blog

    ReplyDelete
  5. Hi,

    Can you please help me with this,
    I am using a clustered node of 2 servers where my polling interval is 5 mins, max transaction size as 10 and number of threads as 2, but the server is polling 10 rows from the DB instead of 20

    ReplyDelete
  6. can we write same file in two different location using file adapter at same time.

    ReplyDelete
  7. Those guidelines additionally worked to become a good way to recognize that other people online have the identical fervor like mine to grasp a great deal more around this condition. and I could assume you are an expert on this subject. Same as your blog i found another one Oracle Fusion Cloud Technical .Actually I was looking for the same information on internet for Oracle Fusion Cloud Technical and came across your blog. I am impressed by the information that you have on this blog. Thanks a million and please keep up the gratifying work.

    ReplyDelete
  8. Thanks for sharing this great information I am impressed by the information that you have on this blog. Same as your blog i found another one Oracle SOA . Actually I was looking for the same information on internet for Oracle SOA and came across your blog. I am impressed by the information that you have on this blog. It shows how well you understand this subject, you can learn more aboutOracle SOA . By attending Oracle SOA Training .

    ReplyDelete
  9. Hi Kumar, right now we have a problem with HA File Adapter. The process only read the first batch in a large file (we set the size with the property publish size) and after that end the process and delete the file. It does not read all the records, What could be the cause?

    ReplyDelete
  10. Thanks and I have a dandy give: How Much Remodel House remodelers

    ReplyDelete