Spring boot Apache camel,无法再次从FTP获取文件
我的表情是这样的:Spring boot Apache camel,无法再次从FTP获取文件,spring-boot,apache-camel,Spring Boot,Apache Camel,我的表情是这样的: sftp://hostname/path?username=username&password=password&fileName=fileName.txt&connectTimeout=10000&soTimeout=40000&timeout=40000&stepwise=false&maximumReconnectAttempts=4&autoCreate=false&strictHostKeyCh
sftp://hostname/path?username=username&password=password&fileName=fileName.txt&connectTimeout=10000&soTimeout=40000&timeout=40000&stepwise=false&maximumReconnectAttempts=4&autoCreate=false&strictHostKeyChecking=no&preferredAuthentications=publickey,password&disconnect=true&stepwise=false&throwExceptionOnConnectFailed=true&consumer.bridgeErrorHandler=true
我在这里使用这个表达:
from(GET_FILE_FROM_SFTP)
.log(LoggingLevel.INFO, DOCUMENT_RECONCILIATION_ROUTE, "Getting the file from SFTP")
.pollEnrich()
.simple("${exchangeProperty.sftpExpression}")
.timeout(20000L)
.to(SAVE_RECEIVED_IDS)
.end();
在第一次执行时,它可以获取文件。但第二次,当我再次触发时,它会在放置以下日志时等待:
Known host file not configured, using user known host file: C:\Users\caner/.ssh/known_hosts
并转到下一个路径,但因为文件是空的,所以无法继续
为什么它不能第二次拿走这个文件?我删除了文件并再次将其放到ftp,但仍然无法获取它
当我在那个表达式中把文件名作为同一目录中的另一个文件名,然后再试一次,它就可以得到这个文件了
是否有无法再次获取的第一个文件的锁定?设置选项
noop=true
以禁用完成后的文件移动。您还需要idempotent=false
来禁用
看
noop
如果为true,则不会以任何方式移动或删除文件。此选项适用于只读数据或ETL类型需求。如果noop=true,Camel也将设置幂等元=true,以避免反复使用相同的文件
idemponent
选项使用幂等消费者EIP模式让Camel跳过已处理的文件。默认情况下,将使用基于内存的LRUCache,该LRUCache可容纳1000个条目。如果noop=true,则还将启用幂等项,以避免反复使用相同的文件
这可能会有帮助:我做了幂等项false并运行了多次。这次:
Type:org.apache.camel.component.file.GenericFileOperationFailedException,消息:无法检索文件:,导致堆栈跟踪:[com.jcraft.jsch.ChannelSftp.get(ChannelSftp.java:1513),com.jcraft.jsch.ChannelSftp.get(ChannelSftp.java:1266),