Announcement Announcement Module
No announcement yet.
FTP inbound channel adapter without poller and instead rely on control bus? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • FTP inbound channel adapter without poller and instead rely on control bus?

    One of the requirements for ftp-inbound-channel-adapter is a poller.

    is it possible to create a "non-polling" poller.

    I would like to fire it once per message via control bus.

    Basic flow:
    mail-inbound-channel-adapter ->
    channel ->
    service activator ->
    send message to control bus to start ftp-inbound-channel-adapter to run once eg
    controlChannel.send(new GenericMessage<String>("@ftpInboundChannelAdapter.start()"));
    ftp-inbound-channel-adapter runs until max-messages-per-poll ->
    sleeps indefinitely until next control bus message

    is this even the correct approach?

    Thanks in advance

  • #2
    You seem to inquire about a solution but fail to mention the problem you are trying to solve But based on what i can gather what you want is an event driven FTP Get. Right?
    If so please look at FTP Outbound gateway sample


    • #3
      hi oleg

      yes, essentially I want to replace the "event" that happens on the polling interval, with my own event, eg control bus, or message on channel, etc

      more description of my usecase.

      We request via a 3rd party, to give us their latest data. The time between the request for the data, and the availablity of the new files on their FTP server is not fixed, it could be 1 minute, or 1 hour. the new data could also be 1-N number of files. they also do no upload the data with a "processing" suffix, so we could be in the situation, if we just used a straight up ftp-incoming-channel-adapter, where we have corrupt/incomplete files.

      When the data is ready for download, they send an email.
      So essentially I want to poll the mailbox as usual, until I find the mail I am looking for, and then use this "event" to trigger my ftp-inbound-channel-adapter to then download the file(s). the ftp-inbound-channel-adapter then waits until it gets it's next "event", and the process repeats


      • #4
        Cool, so try what i suggested before (FTP Outbound Gateway)


        • #5
          The sample Oleg pointed you to does ls->splitter->get->rm

          The gatway also supports mget where you give it a pattern of files "/foo/bar/*.txt"


          • #6
            FTP Outbound Gateway. What a great piece of kit. I completely looked this by, as I just saw outbound, and associated it with Outbound Channel Adapter

            thanks a stack guys