Hi,
We have a spring batch based file processing. The spring batch job uses spring integration to fetch the file and
launch the job. Below are the configuration details.
HTML Code:<bean id="sftpSessionFactory" class="org.springframework.integration.sftp.session.DefaultSftpSessionFactory"> <property name="host" value="****"/> <property name="port" value="****"/> <property name="user" value="****"/> <property name="password" value="****"/> </bean> <int-sftp:inbound-channel-adapter id="InboundChannelAdapter" session-factory="sftpSessionFactory" channel="InChannel" filename-pattern="*.txt" remote-directory="/home/sftp/remote" local-directory="/home/app1/local" delete-remote-files="true" auto-create-local-directory="true" > <int:poller fixed-rate="1000" /> </int-sftp:inbound-channel-adapter> <int:channel id="InChannel"> <int:queue capacity="25"/> </int:channel> <int:service-activator input-channel="InChannel" ref="fileuploadServiceImpl" method="parseFile"/>
Everything works fine when deployed on a single tomcat server. We tried to deploy the application in two tomcat instances on different machines. When a file was dropped in the sftp location, both the applications deployed in the tomcat servers picked up the file. How do we ensure that only one tomcat instance picks up the file for processing? The size of the file was around 5 MB.


Reply With Quote
