Search code examples
springspring-bootspring-integrationspring-integration-dslspring-integration-sftp

Spring Integration `RotatingServerAdvice` Polling


When RotatingServerAdvice is added as an advice to a Poller, as in

PollerSpec pollerSpec = Pollers.cron(cronExpression)
                                       .advice(rotatingServerAdvice(sftpConfig, proxyConfig))
                                       .maxMessagesPerPoll(3)
                                       .errorChannel("errorChannel");

will the poller rotate through each RotationPolicy.KeyDirectory at the scheduled time, or will it check one directory per poll? I've checked the examples in the Spring Integration Github repo and the reference documentation but I'm not able to get clarity on this. I'm guessing it should be the first, but I'd like to confirm.


Solution

  • Please, clarify why do you see a difference between scheduled time an poll? The poll really happens only when scheduler comes to the task to perform.

    There is a fair option for you to consider. See docs: https://docs.spring.io/spring-integration/docs/current/reference/html/ftp.html#ftp-rotating-server-advice