5 Replies Latest reply: Sep 10, 2013 11:20 PM by AbhishekJ RSS

    Can schedule FTP Adapter to start to listen to a FTP directory?

    Alena

      Hi SOA Gurus,

       

      There is a desired requirement that a SOA composite to start to pick up files on FTP directory on schedule. As we know, the FTP Adapter keep listening to the directory, once there is a file arrived, FTP Adapter will pick it up immediately and then kick off the rest process. However, this is not desired all the time. We would like the files sitting there, until he schedule up, the process pick them up.

       

      Is that possible by changing jca, ftp. properties to do that? Or need to use trigger file?

       

      We also have the similar requirements for JMS Adapter? Can we achieve starting to pick message from the queue on schedule?

       

      Thank you very much in advance for your advice.

       

      I am looking forward to meeting you in this forum.

       

      Alena Li

      CGI


        • 1. Re: Can schedule FTP Adapter to start to listen to a FTP directory?
          AbhishekJ

          SOA Suite does not provide a user available scheduler. You can use a custom scheduler to invoke composites if required. Search this forum for Quartz scheduler with SOA/OSB and you should be able to find some examples.

          As far as your specific requirements, you can have a custom scheduler invoke a composite and within a BPEL you can invoke a Sync Read FTP/File adapter to read the files when composite is invoked.

          Alternatively you can also configure a scheduler in OEM to invoke a bash script which creates a trigger file at specific schedule and configure your Polling FTP/File adapter to use trigger file.

           

          For JMS it is more tricky as there is no Sync Read provided. It would be easier to actually not use JMS for such a requirement. Or if there is a constraint that source application can only send messages on a JMS queue, you can have a composite which will transfer all messages in real time to another persistent storage (a DB or local files) and then use a similar scheduler initiated composite as mentioned above to process from local persistence store based on a schedule.

          • 2. Re: Can schedule FTP Adapter to start to listen to a FTP directory?
            Alena

            Thank you, Abhi for your quick response.

             

            Yes, we have a custom scheduler available. And we can invoke a composite on schedule. I understand this part well. But I don't know how to invoke "Sync Read FTP/File adapter to read the files". As I understand in regular, FTP Adapter act as a listener which listen to the file arrivals. How to make Sync Read FTP/File Adapter? I am interested in learning this part. That may be fit our requirements.

             

            Thank you again

            Alena

            • 3. Re: Can schedule FTP Adapter to start to listen to a FTP directory?
              AbhishekJ

              When you create an FTP adapter, drag and put it in references section, in the wizard when you reach Operations page, select Synchronous Get File as operation. In sync read mode, FTP adapter will need to be invoked (from a BPEL or Mediator) and when invoked it will read the files. This is different from Get file operation of FTP Adapter where the adapter will keep polling to the directory specified and will initiate an instance as soon as it can find a file. In your case you can have a scheduler invoke a composite, in the composite invoke a Synchronous Get File type of FTP adapter to read the files, that way you can control when the files are processed.

              • 4. Re: Can schedule FTP Adapter to start to listen to a FTP directory?
                Alena

                Thank you, Ahbi. That is exactly what our business is looking for.

                I am so excited and created one FTP Adapter immediately and try to invoke within a BPEL process. However, After link "invoke" activity to the partner link of FTP Adapter, the "Port Type" and "Operation" both drop down are empty. I can't find Synchronous Get File. What I am missing?

                Please help!

                Alena

                • 5. Re: Can schedule FTP Adapter to start to listen to a FTP directory?
                  AbhishekJ

                  Sometimes linking them by dragging the connector from Invoke to the target Adapter does not work as expected. Instead of that double click on the Invoke activity, click on the hourglass icon in front of Partner Link box and select the FTP adapter which you created earlier. Once adapter is selected you will be able to select the operation from drop down. Remember that operation name here will be whatever text you entered while creating FTP Adapter. Synchronous Get Read was the Operation Type you selected in FTP Adapter wizard on Operation page, it is different from Operation Name which you must have entered in text box on the same page. Within the Invoke action you will be able to select the Operation Name not the Type.