on 08-01-2016 3:50 PM
Hello Experts,
We are developing a custom adapter module for picking the files through SFTP, sorting and placing in destination.
The scenario is as below:
1. All the files will have a Date attached to its name.
2. Our adapter module should read the files on a particular path through SFTP, and sort based on the date (provided in the file name).
3. Put it in another folder over SFTP
We have a written a Custom adapter module for this task.
Inside this module, we are getting parameters that are required for connecting to SFTP like username, password, host, port, etc... All these parameters are also passed from module configuration.
While picking the files from a source directory, in communication channel level, it is showing the below error
cannot send message to module processor:com.sap.aii.af.lib.mpmodule.moduleException: one of the parameter is null.
Error while sending message:cannot send message to module processor:com.sap.aii.af.lib.mpmodule.moduleException: one of the parameter is null.
We have placed some Audit.addAuditLogEntry and wrote some messages right from the beginning. Even these messages are not visible
We are not sure whether the error is from the custom adapter module or whether it is not executing the adapter module itself. We are not sure how to proceed further.
Your help on this highly appreciated
Hi Sujai,
Is your requirement is to read files in sorted order ?
If it is the requirement then I don't think that you need an custom module for this. Just try with picking the file configuring the CC - Record Set sequence as ascending order.
Thanks,
Apu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Lokesh ,
Well i am out of suggestions of suggestions , but below are my points :
Br,
Manoj
Apu Das wrote:
Hi Sujai,
Is your requirement is to read files in sorted order ?
If it is the requirement then I don't think that you need an custom module for this. Just try with picking the file configuring the CC - Record Set sequence as ascending order.
Thanks,
Apu
No Apu... My requirement is there will be a set of files placed in a particular directory. I need to pick those files, sort them based on the date (which is specified in the file name itself), and place it in the sorted order in another folder
Hi Sujai,
Sujai Kaarthik wrote:
sort them based on the date (which is specified in the file name itself), and place it in the sorted order in another folder
I'm confused by this statement here - how does a folder have a sorted order? A folder is simply a place in the file system that contains data and there is no order. Also, what do you do for the case when multiple files have the same date?
Hi Ryan,
Of course I agree with you that folder can have files in any order. But it will store in the order that we put it into them right? That is why file name is going to have dates on it.
In our case, the file content will be some data related to a particular geographical area for one particular day. A file name will not have only dates on it. For example, a file name will <AreaCode>_<AreaName>_<Date>. Like this, they may place multiple files for different geographical areas and different dates.
As for the case if we have 3 files with names as say IND_TN_20160802, IND_TN_20160801 and USA_LA_20160802, I can place the 2 files (IND_TN_20160802 and USA_LA_20160802) in the target directory in any order after I am done with moving the file IND_TN_20160801 first to the target directory.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Manoj,
When we see the nwa logs, we are getting the below text:
Severity: Error
Category: Single Click Filter by Category Negative Single Click Filter by Category com.sap.aii.adapter.sftp.ra.rar.jca.SFTP2XI
Location: Single Click Filter by Location Negative Single Click Filter by Location com.sap.aii.adapter.sftp.ra.rar.jca.SFTP2XI.sendMessageFromSftp(byte[] file, FAttributes fileAtts, HashMap attachments, Channel channel, Connection con, String home)
Data Source: j2ee/cluster/server0/log/defaultTrace_00.trc
Hi Sujai,
We cant make sure what parameter is missing according to the log.
This is the reason why i refereed the above blog so that you can test locally in your NWDS/Desktop and then you may deploy the module in PI. It will be quick and easy way to test the custom module.
But as per the requirement mentioned in this thread
If you need to pick the files on current date you may check below threads : Because even though you create custom module the modules are called once the file are picked
How to pick up the file based on Current date ? | SCN
Br,
Manoj
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.