First, thank you for your attention i defined two ftp inbound-channel-adapter in my spring integration project,the adapters with diferent configuration but have share session factory to connect ftp server, each adapters have one poller to trigger,i want to see the bellow code is correct? is efficiency?
<bean id="ftpClientFactory"
class="org.springframework.integration.ftp.session.DefaultFtpSessionFactory">
<property name="host" value="127.0.0.1"/>
<property name="port" value="21"/>
<property name="username" value="banks_reader"/>
<property name="password" value="123456"/>
</bean>
<bean id="myFilter" class="com.ali.util.FtpFilter"/>
<bean id="onceFilter" class="com.ali.util.OnceFilter"/>
<int-ftp:inbound-channel-adapter id="ftpInbound1"
channel="inboundFileChannel"
**session-factory="ftpClientFactory"**
charset="UTF-8"
auto-create-local-directory="true"
delete-remote-files="true"
remote-directory="/directoryA"
remote-file-separator="/"
temporary-file-suffix=".writing"
local-filter="myFilter"
filter="onceFilter"
local-directory="file:output">
**<int:poller fixed-rate="5000"/>**
</int-ftp:inbound-channel-adapter>
<int-ftp:inbound-channel-adapter id="ftpInbound2"
channel="inboundFileChannel"
**session-factory="ftpClientFactory"**
charset="UTF-8"
auto-create-local-directory="true"
delete-remote-files="true"
remote-directory="/directoryB"
remote-file-separator="/"
temporary-file-suffix=".writing"
local-filter="myFilter"
filter="onceFilter"
local-directory="file:output">
**<int:poller fixed-rate="5000"/>**
</int-ftp:inbound-channel-adapter>
Is there another way?
Aucun commentaire:
Enregistrer un commentaire