App Connect

App Connect

Join this online user 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
  • 1.  SFTP using Java compute node

    Posted Wed January 10, 2024 05:51 AM

    We are trying to read the file list from the SFTP location and then iterate each file to encrypt it and save it to output location.

    We are using MQ input as our first node, we would need a Java compute node to connect to a SFTP location and list out all the files in that location.... 

    Question - is there any node that already exists in ACE 12, if not are there any Java node samples that we can use to achieve the above scenario 



    ------------------------------
    Kareem Qureshi
    ------------------------------


  • 2.  RE: SFTP using Java compute node

    Posted Thu January 11, 2024 01:57 AM

    FileInput Node provides support for reading files from FTP/SFTP server. I don't think you need to implement custom logic for reading files from SFTP using Java.

    Whenever a new file has been placed on SFTP Server, message flow will be notified about it through FileInput Node.



    ------------------------------
    Irfan Shahzad
    Integration Architect
    ------------------------------



  • 3.  RE: SFTP using Java compute node

    Posted Thu January 11, 2024 04:09 AM

    FileExists Node provides support similar to the FileInput Node and allows for processing a list of files at a time but does not open/read the files.

    FileIterator Node can iterate over the list produced by the FileExists Node and then pass the metadata on in a format the FileRead Node and FileOutput Node can use

    For more information you can see my blog post from last year which includes a video showing the above nodes in action.



    ------------------------------
    Daniel Robinson
    ------------------------------



  • 4.  RE: SFTP using Java compute node

    Posted Thu January 11, 2024 10:25 AM

    @Irfan Shahzad @Daniel Robinson

    Thanks for your inputs... the flows are triggered by an Enterprise Scheduler not when there is file in the folder. FileExists Node is ideal but cannot be added in the flow after MQ Input node. As we have a requirement to encrypt each file in the folder so need to iterate for each file in the folder... We thinking to use JCN to SFTP list files in the folder and then iterate over each file to encrypt it...



    ------------------------------
    Kareem Qureshi
    ------------------------------



  • 5.  RE: SFTP using Java compute node

    Posted Fri January 12, 2024 12:38 AM

    I want to understand why you want to place FileExists Node after MQInput Node. Does MQ message received on MQInput Node contains information about the file to be read and processed? If this is the case, then you can use FileRead node in between the flow to read the content of the file and then use Compute node (either Java or ESQL) to perform encryption and further processing.

    Just to clarify, both FileInput and FileExists nodes performs polling operation and message flow will be triggered whenever a file is placed on the specified location. Only difference between FileExists and FileInput Node is that FileExists node doesn't read the content of the file and simply provides the notification about the file. This is useful when the file needs to read optionally and can have size and performance implications.



    ------------------------------
    Irfan Shahzad
    Integration Architect
    ------------------------------