我正在尝试使用camel实现一个场景,如下所示:-
-
从JMS队列获取文件。
-
将文件和文件的crc值存储在目录中
- 将文件和crc文件移动到SFTP服务器,一旦成功从目录中删除文件
我的路线如下
from("jms:queue")
.to(save the file)
.process(since I have the content of the file in exchange so generating crc)
.to(file system save the crc file)
.to(Push both the files to the sftp server);
但是上传到sftp服务器的文件只是crc文件,因为它在交易所中存在。我应该如何解决这种情况?如果你们中有人遇到这个问题,请指导我。感谢
我认为您应该使用窃听器将您的交换复制到另一个路由,并让新路由保存文件并将其sftp到正确的位置。
from("jms:queue")
.wireTap("direct:save-file")
.process(since I have the content of the file in exchange so generating crc)
.to(file system save the crc file)
.to(Push file to the sftp server);
from("direct:save-file")
.to(save the file)
.to(Push file to the sftp server);