I have an SFTP directory and reading files and sending files for further processing in ServiceActivator. At any time, I need to process them in parallel using a handler.
Here is my DSL stream for SPring integration.
IntegrationFlows.from(Sftp.inboundAdapter(getSftpSessionFactory()) .temporaryFileSuffix("COPY") .localDirectory(directory) .deleteRemoteFiles(false) .preserveTimestamp(true) .remoteDirectory("remoteDir")) .patternFilter("*.txt")), e -> e.poller(Pollers.fixedDelay(500).maxMessagesPerPoll(5))) .handle("mybean", "myMethod") .handle(Files.outboundAdapter(new File("success"))) .deleteSourceFiles(true) .autoCreateDirectory(true)) .get();
Update: here is my ThreadPoolExecutor:
@Bean(name = "executor") public Executor getExecutor() { ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); executor.setCorePoolSize(4); executor.setMaxPoolSize(4); executor.setQueueCapacity(20); executor.initialize(); return executor; }
java spring spring-integration dsl spring-integration-sftp
Harish Mar 11 '16 at 23:03 2016-03-11 23:03
source share