Я новичок в весенней интеграции. Пожалуйста, извините меня, если я прошу что-то обычное. У меня есть один простой вариант использования. Я настроил адаптер входящего канала ftp, как показано ниже. Используя его, я могу вытащить файлы удаленной проверки в локальный каталог. i.e.D:/Исходящий. Теперь я хочу опросить локальный каталог, т.е. i.e.D:/Outbound, чтобы добавить дополнительную бизнес-логику. т. е. Загрузите исходный файл с удаленного компьютера на основе состояния файла проверки и переместите соответствующие файлы проверки в другое место в каталоге. Как я должен это делать ? Будем признательны за любой образец быстрого кода или справочное руководство/ссылки.
<?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="http://www.springframework.org/schema/integration"
xmlns:int-ftp="http://www.springframework.org/schema/integration/ftp"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/integration/ftp http://www.springframework.org/schema/integration/ftp/spring-integration-ftp.xsd">
<context:property-placeholder location="/ftp/ftp.properties"/>
<context:component-scan base-package="com.sandbox.ftp"/>
<!-- FTP inbound channel adapter for reading the input check files -->
<int-ftp:inbound-channel-adapter id="ftpInbound"
channel="ftpInboudChannel"
session-factory="ftpClientFactory"
auto-create-local-directory="true"
local-directory="D:/outBound"
remote-directory="."
filename-regex=".*\.chk$">
<int:poller fixed-rate="5000" />
</int-ftp:inbound-channel-adapter>
<int:channel id="ftpInboudChannel"/>
<!--Service Activator which will intiates the download of original source file -->
<int:service-activator input-channel="ftpInboudChannel" ref="myPojo" method="processFile" />
<bean id="myPojo" class="com.sandbox.ftp.CheckFileProcessor" />
<!-- FTP inbound channel adapter for downloading the original remote files -->
<int-ftp:inbound-channel-adapter id="ftpInboundDownload"
channel="ftpInboudDownloadChannel"
session-factory="ftpClientFactory"
auto-create-local-directory="true"
local-directory="D:/outBound/original"
remote-directory="."
filename-regex=".*\.txt$">
<int:poller fixed-rate="5000"/>
</int-ftp:inbound-channel-adapter>
<int:channel id="ftpInboudDownloadChannel"/>
</beans>
Теперь, основываясь на комментарии Гэри, я использовал активатор службы и смог загрузить исходные файлы, т.е. *.текст. Теперь я хочу переместить связанные файлы проверки в ту же папку после загрузки исходного файла. то есть *.chk в D:/outBound/original. Есть предположения ?