SpringIntegrationは初めてです。
Springファイルのinbound-channel-adapterを構成しました。例:
<file:inbound-channel-adapter channel="channel1" directory="${location}" prevent-duplicates="true" filename-pattern="*.csv">
<si:poller>
<si:interval-trigger interval="1000"/>
</si:poller>
</file:inbound-channel-adapter>
<si:service-activator input-channel="channel1" output-channel="channel2" ref="filenameGenerator" method="generate"/>
現在、これは正常に機能しています。ただし、これはクラスター環境にデプロイする必要があります。クラスタ内の複数のインスタンスが同じファイルを読み取ろうとしないようにしたいと思います。それで、これはそのような環境で機能しますか?
いいえの場合、次のようなQuartzスケジューラを使用できますか?
<file:inbound-channel-adapter channel="channel1" directory="${location}" prevent-duplicates="true" filename-pattern="*.csv">
<si:poller task-executor="taskExecutor" fixed-rate="1000"/>
</file:inbound-channel-adapter>
<si:service-activator input-channel="channel1" output-channel="channel2" ref="filenameGenerator" method="generate"/>
<bean id="taskExecutor" class="org.springframework.scheduling.quartz.SimpleThreadPoolTaskExecutor">
<property name="threadCount" value="20"/>
<property name="threadNamePrefix" value="consumer"/>
</bean>
これはうまくいき、私の問題を解決しますか?または、トランザクションを使用する必要がありますか?
質問が明確であることを願っています。
ありがとう、アディ