java - 具有 tempFileName 属性的 Camel 2.23.1 toD(sftp) 正在为每个文件创建一个连接
问题描述
在 Camel 2.23.1 中,我使用带有 SFTP URI 的骆驼“动态到”(toD)来添加动态属性,例如主机、用户名等。这个 URI 包括“tempFileName”属性。
我在此代码示例中看到的内容:
.toD("sftp://${exchangeProperty.username}@${exchangeProperty.host}:${exchangeProperty.port}/${exchangeProperty.folder}"
+ "?privateKeyFile=${exchangeProperty.privatekey}"
+ "&privateKeyPassphrase=${exchangeProperty.keypassphrase}"
+ "&password=${exchangeProperty.password}"
+ "&preferredAuthentications=publickey"
+ "&passiveMode=${exchangeProperty.mode}"
+ "&connectTimeout=${exchangeProperty.timeout_connect}"
+ "&soTimeout=${exchangeProperty.timeout_socket}"
+ "&timeout=${exchangeProperty.timeout_read}"
+ "&tempFileName=inprogress.${file:name}.filepart"
+ "&stepwise=${exchangeProperty.stepwise}"
+ "&fastExistsCheck=${exchangeProperty.fastExistsCheck}"
)
它为每个文件创建一个连接,这不是我想要实现的。
但是,如果我评论或删除“tempFileName”部分,它只需要一个有限的连接池。如果我使用一个简单的端点(to),它也可以工作,有或没有“tempFileName”属性。
我想为每个动态端点(所以没有disconnect
)保留一个连接池,并在上传时定义一个临时文件名。对于文件名,我们通常使用诸如 Exchange.FILE_NAME 和/或 Exchange.FILE_NAME_ONLY 之类的标题,但我没有看到它用于临时文件名。
有人可以帮我吗?
解决方案
推荐阅读
- java - Java 版本反映应用程序 java 而不是容器 java
- c - C 代码无法工作,似乎正在跳过某些代码
- modelica - 热电库中冷凝器蒸汽侧的传热系数如何设置?
- c++ - 在 esp32 上使用 DallasTemperature 和 Wifi.h 时出现 Guru Meditation 错误
- java - 如何连接具有不同分隔符的配置单元列
- javascript - 为什么我的方法不适用于删除 firebase 对象?在 vue 上
- azure-devops - VSTS 扩展 - 如何在加载自定义选项卡时从测试套件表中获取选定的套件数据
- javascript - 尝试使用导航栏切换图标按钮(动画菜单图标)创建覆盖
- moodle - 在学生登录 Moodle 后执行额外验证
- spring-cloud-stream - 由于 Spring 集成依赖关系,LogConsumer Spring Cloud 功能失败