简体   繁体   English

使用apache-camel组播将一个文件上传到不同的位置

[英]Using apache-camel multicast to upload one file to diffeerent locations

How to use multicast to upload one file twice to the same sftp location but two different folders using a single login? 如何使用多播通过一次登录将一个文件两次上传到相同的sftp位置,但上传到两个不同的文件夹?

Say i have locationA as my pick-up location, b & c are my file destination locations in the sftp. 假设我有locationA作为接送地点,b和c是sftp中我的文件目标位置。

I have something like: from(locationA) .multicast() .to(locationb, locationc) 我有类似的东西: from(locationA).multicast().to(locationb,locationc)

I guess this will need loging-in twice but i need to do that once. 我想这将需要登录两次,但我需要这样做一次。

Please help. 请帮忙。

You can try without multicast, and change the file name in the CamelFileName header, and call the same endpoint again. 您可以尝试不使用多播,并更改CamelFileName标头中的文件名,然后再次调用同一端点。 And make sure to have disconnect=false , as that means Camel will reuse the same connection. 并确保具有disconnect=false ,因为这意味着Camel将重用相同的连接。

from X
  to FTP a
  setHeader CamelFileName = new file name
  to FTP a

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

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