cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing File using FTP from Java Mapping

Former Member
0 Kudos

Hi,

There is a requirement to check certain files and move them to certain directories in a FTP server from PI on checking the payload of an outbound interface which is using FTP adapter. The question is whether it is advisable to open the FTP connection from Java mapping in PI and do the file processing as required or it should be done by an adapter module?

Any help will be highly appreciated.

Thanks,

Dipankar

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

>>payload of an outbound interface which is using FTP adapter

why not do this via "Conditional Interface determination"

That is the standards way through which we branch off message based upon the contents of payload,you can also use "Conditional receiver determination" if you have different receiver systems.

Please update the thread if your requirement is different.

Thanks

Aamir

former_member181985
Active Contributor
0 Kudos

It would be better to go with Adapter Module.

former_member4529
Active Contributor
0 Kudos

Hi,

Can you pls explain the pros and cons?

Thanks,

Dipankar

former_member181985
Active Contributor
0 Kudos

If you implement in mapping, there can a possibility of more than one transaction on FTP server in case of mapping failure( as you will resend the failed message). Also the performance gets degraded as mapping is part of PIPELINE steps.

If you do it in the module level, you can better manage FTP connections and operations.

Thanks,

- Gujjeti.

former_member4529
Active Contributor
0 Kudos

Hi,

The module processor will be an EJB. Is it advisable to do File I/O from an EJB?

Thanks,

Dipankar

ravi_raman2
Active Contributor
0 Kudos

Ideally SAP recommends not using an adapter Module for File I/O as the overheads are huge..

Can you explain your requirements with a bit more of clarity..

Regards

Ravi Raman

former_member4529
Active Contributor
0 Kudos

Hi,

The requirement is the input message to PI is a file from the FTP server which is picked up by the FTP sender adapter in PI. After picking it up it has to be determined whether it's ready for processing by checking certain files present in the FTP server. These config files are separate files and are not available in the PI payload. Also a log file has to be written to the FTP server with the processing information and validation results during the message processing in PI and if the payload file is finally processed it has to be archived in a specific folder in the FTP server. I know these are not the usual functionality to be expected from a middleware but in this case it has to be implemented by PI only. So as there'll be number of FIle I/O operations during the process I like to clarify which one will be the best option to do this - adapter module or Java Mapping or if there are any other alternatives.

Thanks,

Dipankar

former_member200962
Active Contributor
0 Kudos

poll the FTP server and get the files on which you need to perform the check into XI....check if they have some data....if yes discard them (i.e. do not do any further processing on them) and start the processing of your main file...if no data present then stop the processing of the main file....if possible check the feasibility of using a BPM to perform the check.....

No idea if it can be done by other methods

Regards,

Abhishek.

ravi_raman2
Active Contributor
0 Kudos

As per my understanding of the requirement below,.,

Pick up all the files from the server, run it through a module to do your validation for the config files etc, remember to close all connections if you open any, else it can cause ur JCO pool to overload.

Run it through a BPM, get a response, write the results etc to a file.

keep all the IO inside the module.

If you need further specifics or any help on the module do let me know.

Regards

Ravi Raman

former_member4529
Active Contributor
0 Kudos

Hi Ravi,

By module are you suggesting writing the File I/O logic inside a module processor in the adapter engine? If yes then my question is as the module processor is an EJB is it at all recommended to do File I/O from an EJB?

Thanks,

Dipankar