简体   繁体   English

使用Apache Camel SFTP时如何按顺序使用文件

[英]how to consume files in order when using Apache Camel SFTP

I am using Apache Camel to handle files in a SFTP directory.The directory will receive many files in the same time.What can I do to control camel consumes the file in order?我正在使用Apache Camel处理SFTP目录中的文件。该目录将同时接收许多文件。我可以做什么来控制camel按顺序消费文件? For example,directory my_directory will receive file file1,file2,file3,file4 in the same time.例如,目录my_directory将同时接收文件 file1,file2,file3,file4。 I want camel to consume then in the order of file1-file2-file3-file4.我希望骆驼按照file1-file2-file3-file4的顺序消费。

您是否看过选项preSort

From this section , you could sort the file by file name with sortBy option在本节中,您可以使用sortBy选项按文件名对文件进行排序

This will sort by file name这将按文件名排序

sortBy=file:name

PS you may find many useful info from File component for FTP/SFTP component PS,您可能会从文件组件中找到许多有用的信息,用于 FTP/SFTP 组件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM