webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

File transfer between 2 FTP servers using wM

  • 1.  File transfer between 2 FTP servers using wM

    Posted Fri December 11, 2009 06:39 AM

    Hi, In one of our implementation we have to transfer the files from one FTP server to another FTP server using webMethods. I was going through the ftp BIS and it says we can specify “largefilethreshold” to read a large files. But do we have any constraints on the file size that we can read and put to another ftp server using webMethods.

    When we try to read (get) a file of size 20 GB, does this operation consumes any huge memory in wM. Will this affects IS performance?

    What will be the right design to read a large file and transfer it to another FTP server through wM? (we need to do plain transfer…not to parse the data).

    (Eventhough wM is not a right FTP client to transfer files from one ftp server to other, we need this to do it as we can actively monitor the transfer with monitoring team we have)


    #webMethods
    #Integration-Server-and-ESB
    #webmethods-Protocol-and-Transport


  • 2.  RE: File transfer between 2 FTP servers using wM

    Posted Fri December 11, 2009 09:26 PM

    If you need to handle such huge file, you can’t keep it in memory, you have to stream it and save it in the local hard drive.

    You can follow the instruction on how to handle large file in WM (WM also save it to disk). The build-in service pub.client.ftp:get, pub.client.ftp:put already has stream parameters.

    Or write some simple java code using: FileInputStream and FileOutputStream.
    This require very small memory footprint and you can handle almost any size doc. keep in mind increase the connection timeout limit to allow the download/upload to finish.


    #webMethods
    #webmethods-Protocol-and-Transport
    #Integration-Server-and-ESB


  • 3.  RE: File transfer between 2 FTP servers using wM

    Posted Wed December 16, 2009 06:36 PM

    Consider using the proxy command. This command is not supported by all FTP servers, but see if yours support it.

    It works kinda like this:

    1. Login to your source FTP server
    2. Issue a proxy open . You can do this using the quote service.
    3. Issue a proxy user
      4) Issue a proxy put

    This way you transfer the file directly from one FTP server to another without having to worry about consuming resources on the webMethods server.

    Good luck,
    Percio


    #webMethods
    #webmethods-Protocol-and-Transport
    #Integration-Server-and-ESB


  • 4.  RE: File transfer between 2 FTP servers using wM

    Posted Wed December 16, 2009 08:41 PM

    Forget about proxy’s, this is a FXP transfer and IS would be the “client” to launch the command without any control. Has lots of problems between firewalls and both FTP servers must support this.

    I don’t see the need to use IS to transfer a 20G file if you do not want to use this file for parsing it.


    #Integration-Server-and-ESB
    #webMethods
    #webmethods-Protocol-and-Transport


  • 5.  RE: File transfer between 2 FTP servers using wM

    Posted Wed December 16, 2009 09:31 PM

    DevNull43,

    Yes, you and I may not see the need to use IS in this scenario. If I had the choice, I wouldn’t. Ravindar also already acknowledged the fact that using IS is not the best solution. This was the requirement he was given nonetheless.

    Thanks for your feedback on the proxy command though. Can you provide a little more detail on the firewall issues you’re referring to though?

    I agree, and previously stated, that this command will not work on all FTP servers. Now, as to your point regarding the IS not having any control over the transfer, I’m not sure I understand. The command is issued by the IS and the IS will receive a response indicating whether the command succeeded or not. Of course, the transfer will be done from FTP server to FTP server directly, but that is the whole point.

    Thanks,
    Percio


    #Integration-Server-and-ESB
    #webmethods-Protocol-and-Transport
    #webMethods


  • 6.  RE: File transfer between 2 FTP servers using wM

    Posted Wed December 16, 2009 09:45 PM

    I’m not saying is not a valid solution, however I recommend not using it.

    Why? As you can read [url]http://en.wikipedia.org/wiki/File_eXchange_Protocol[/url] most FTP servers will have this disabled, due the high bounce risk.

    On the other side, IS is the client and does only have control over the “start” and “end” commands, would not be aware of status (percentege of transfer), transmission speed, and of course cannot be used to reconnect, ressume etc, so that’s all.

    Remote FTP server needs to have all ports (or a range of high-ports for PASV defined) and enabled on the firewall, same for Source FTP server. Behind NAT this usually fails.

    FXP is great! I love that protocol and used for years, however I do not recommnd it due the complex setup in today’s enterprise firewalls.

    If you talk about public FTP sites, then go for it.

    Still your POST give a good alternative in case this is a must, and indeed it might be the only solution :smiley:


    #Integration-Server-and-ESB
    #webMethods
    #webmethods-Protocol-and-Transport


  • 7.  RE: File transfer between 2 FTP servers using wM

    Posted Wed December 16, 2009 10:23 PM

    The steps for using IS to transfer the file:

    1. Login to the source FTP server (A).
    2. Use get to retrieve the file from A. Specify 0 for the largefilethreshold and null for localfile. This will write the content to a temporary file and return an input stream.
    3. Logout of A.
    4. Login to the target FTP server (B).
    5. Use put to put the file to B. Pass the stream returned by the get in step 2.
    6. Close the stream (just to be safe in case put doesn’t do so).
    7. Logout of B.
    8. Remove/archive the temp file–I’m not sure if IS automatically deletes the file on close. If it doesn’t, then you’ll want to use an explicit dynamic filename in the get in step 2 so you can move/delete it later.

    Of course check errors after each step.

    Be sure to use transfermode set to binary if appropriate (usually the case).


    #Integration-Server-and-ESB
    #webmethods-Protocol-and-Transport
    #webMethods


  • 8.  RE: File transfer between 2 FTP servers using wM

    Posted Thu December 17, 2009 06:49 AM

    Thanks everyone for the detailed reply. We will try out these options with large file and let you know the results for all our reference


    #webMethods
    #Integration-Server-and-ESB
    #webmethods-Protocol-and-Transport


  • 9.  RE: File transfer between 2 FTP servers using wM

    Posted Fri January 29, 2010 05:50 AM

    Hi Ravi,

    have you achieved your objective…

    If yes, then what approach you followed … as I am having similar requirement in my project …

    regards

    NN


    #webmethods-Protocol-and-Transport
    #webMethods
    #Integration-Server-and-ESB