|
Blogs
We had a requirement in one of our project, to stop the processing of duplicate files at the adapter level i.e. the message should not enter the integration engine, if the file has been already processed earlier. There was a chance that client might place a file at FTP location more than ones.
Here we have used two text file at server to maintain the name of processed file and the password of the FTP. Example: name.txt and FtpPassword.txt.
The developed module code has the following functionality.
To implement this functionality, we had written a module code. This module code will keep the name of files as record which will be checked before processing of the next file. If the file has been already processed, it will throw an error at adapter level which in turn can trigger alerts.
For step by Step procedure of the creation of adapter module, please refer the following pdf:
The code for the adapter module:
And to maintain jndi name edit ejb-j2ee-engine.xml:
This jndi Name will be used at the time of calling this module in communication channel.
Scenario to test the Custom Module: Configuration of sender channel: To pick any file available at FTP location To delete the file :
The adapter specific message attribute must be checked (so that message can hold all the checked value which will be used by module code).
The Module Tab of the Sender communication channel.
FtpUser: user name of the client FTP Location: The complete paths of the text file which will keep the record of the processed file PassLocation: The complete paths of the text file which will maintain the password of the FTP client
Testing
Case1: When a new file will be placed at FTP location.Example: sanjaisw.xml
we can see in the text file name.txt : sanjaisw.xml has not been processed earlier:
In SXMB_MONI
The text file on the server: the file name sanjaisw.xml has been added at the last place as shown below.
Case2: When a duplicate file will be placed at FTP location: Example: sandeep.xml (we can see below, sandeep.xml has been already processed)
Place the file at FTP Location
After some time file will be deleted as shown below:
But this file will not be send to the integration engine as shown below. Here it is showing only one file has been processed and that is the previous one.
We can see error: Go to Runtime Workbench à Message Monitoring à select Adapter engine XI1 and click on display as shown below:
After that select your message.
And we can see there is no change in the text file that is stored at server:
sandeep jaiswal is a XI consultant in Capgemini. Add to: del.icio.us | Digg | Reddit
| |||||||||||||||||||||