我正在使用一个 Spring Integration 应用程序,它应该遍历目录的内容,处理其中的文件,然后退出。
我已经在下面设置了 XML 以每秒轮询目录,但这并不是我所追求的。如何更改它以读取目录中的所有文件,然后在消息完成流过系统后让我的程序退出?
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:int-file="http://www.springframework.org/schema/integration/file"
xmlns:int="http://www.springframework.org/schema/integration"
xsi:schemaLocation="http://www.springframework.org/schema/integration/xml http://www.springframework.org/schema/integration/xml/spring-integration-xml-2.1.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.1.xsd
http://www.springframework.org/schema/integration/file http://www.springframework.org/schema/integration/file/spring-integration-file-2.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd >
<int-file:inbound-channel-adapter
directory="inputDir"
channel="inputChannel">
<int:poller fixed-rate="1000"></int:poller>
</int-file:inbound-channel-adapter>
<!-- more components to read from inputChannel, write to output adapter -->
</beans>