Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-8639

Camel FTP component cannot recover after network failure

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.15.3, 2.16.0
    • Component/s: camel-ftp
    • Labels:
      None
    • Estimated Complexity:
      Novice

      Description

      Camel FTP endpoint cannot recover by itself after network failure if no custom PollingConsumerPollStrategy is defined. Few years ago there was similar issue (https://issues.apache.org/jira/browse/CAMEL-1838), and it was fixed by adding in RemoteFileConsumer:
      this.setPollStrategy(new RemoteFilePollingConsumerPollStrategy());

      However it is broken again, as FtpEndpoint is overriding it with DefaultPollingConsumerPollStrategy in initConsumerProperties method, inherited from ScheduledPollEndpoint. I believe RemoteFilePollingConsumerPollStrategy should be used as default in RemoteFileEndpoint as well.

      Adding this.setPollStrategy(new RemoteFilePollingConsumerPollStrategy()); in RemoteFilePollingConsumerPollStrategy should fix this issue.

      Workaround for this bug is to create RemoteFilePollingConsumerPollStrategy in the registry and provide it directly to FTP endpoint by adding consumer.pollStrategy=#myRemoteFilePollingConsumerPollStrategyBeanId to the URL. This is also why FromFtpSimulateNetworkIssueRecoverTest didn't catch it - it's using custom PollingStrategy.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                davsclaus Claus Ibsen
                Reporter:
                Khajiit Marcin Marzyński
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: