exception - camel ftp2 file throw error when there is no file present in the folder
问题描述
I am working on reading the files from the sftp path and process the plain text files that are kept on the server every 5 hours. There is a requirement where I need to throw an exception when there is no file present/kept on the server by the producer. I am using the following to read the files
from(sftp://NUID@SERVER:PORT?&preferredAuthentications=password&delete=true)
.routeId(ROUTE_ID)
.log("${body}")
.process(processor)
.end();
Now if there is no file present when the above route starts it doesn't say anything once there is a file on the server it consumes and process it. I want to throw an exception if there is no file present during a period of time.
解决方案
您收到的异常是什么?
我检查了文档http://camel.apache.org/ftp2.html,这可能是由于选项未设置为 true 造成的。请再试一次,ignoreFileNotFoundOrPermissionError=true
并检查文档中可能适用的其他选项。
推荐阅读
- php - Laravel 5.8 通知独立目标 [Illuminate\Contracts\Notifications\Dispatcher] 不可实例化
- java - 在运行时修改 jarfile
- javascript - 在 React Native 中为 SVG 设置高度时宽度不会改变
- sql - 返回过去 12 个月内没有活动但当月有活动的所有行?
- javascript - 打字稿:将类型定义为具有部分存在对象的类型的联合
- firebase - 如何根据 Flutter 中的订阅向用户发送 Firebase 推送通知?
- swiftui - 如何通过另一个可观察的 0bject 观察已发布的属性 - Swift Combine
- javascript - 如何将对象时间戳转换为 Firebase 时间戳?
- css - 允许自定义 CSS 的危险
- javascript - 添加数据表分页