改变骆驼的交换内容

时间:2015-11-11 10:06:09

标签: java apache-camel

我正在尝试使用camel实现一个场景,如下所示: -

  1. 从JMS队列中获取文件。

  2. 将文件的文件和crc值存储在目录

  3. 将文件和crc文件移至SFTP服务器并成功完成 从目录中删除文件。
  4. 我的路线如下

    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文件,因为它存在于交换机中。 我该如何解决这种情况? 如果你们中的任何人遇到过这个问题,请指导我。 谢谢

1 个答案:

答案 0 :(得分:0)

我认为您应该使用wire tap将您的交易所复制到其他路线,然后让新路线保存文件并将其拖到正确的位置。

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);
相关问题