<bean id="inFileHandler"
class="com.yahoo.FileProcessHandler" />
<bean id="executorService" class="java.util.concurrent.Executors" factory-method="newSingleThreadExecutor" destroy-method="shutdownNow" />
<int:channel id="inChannel" />
<int:channel id="outChannel">
<int:queue capacity="5" />
</int:channel>
<bean id="sftpFactory"
class="org.springframework.integration.sftp.session.DefaultSftpSessionFactory">
<property name="host" value="${SFTP_HOST}"></property>
<property name="port" value="${SFTPPORT}"></property>
<property name="user" value="${SFTPUSERNAME}"></property>
<property name="password" value="${SFTPPASSWORD}"></property>
</bean>
<sftp:inbound-channel-adapter id="ftpInBound" channel="inChannel"
session-factory="sftpFactory"
delete-remote-files="true" remote-directory="/Files"
local-directory="file:C:/Bhaji">
<int:poller id="poller" fixed-rate="10000"/>
</sftp:inbound-channel-adapter>
<int:service-activator input-channel="inChannel"
output-channel="nullChannel" ref="inFileHandler" method="handler" />
and the FileProcess handler is
@Autowired
private ExecutorService executorService;
private static Logger log = LoggerFactory.getLogger(FileProcessHandler.class);
public File handler(File input) {
**//Doing some time taking process**
return input;
}
here while doing the time taking process i don't want to poll the SFTP inbound-channel-adapter. after completion of time taken process the poller should start automatically.
Is there any way to do this ? is there any way to achieve it?