【问题标题】:Is it possible to put in-memory file into camel pipeline?是否可以将内存文件放入骆驼管道?
【发布时间】:2017-10-26 09:50:21
【问题描述】:

我在内存中有org.springframework.web.multipart.MultipartFile,我想将它路由到文件系统中。

例如 sftp 我可以这样写:

public class DummyRoute extends RouteBuilder {
...
    from("sftp://tester@localhost:22/myFolder?password=password&username=tester&idempotent=true")
        .to("file://ftp_files");

是否可以为内存中的普通文件做这样的事情?

附言

我知道我可以将文件保存到第一个文件夹并编写骆驼路线来观看该目录但这是无用的资源浪费

【问题讨论】:

    标签: java file apache-camel spring-camel


    【解决方案1】:

    它正在工作:

    @Autowired
    ProducerTemplate producerTemplate;
    ....
        producerTemplate.sendBody("seda:rest_upload", multipartFile.getBytes());
    

    另一方面:

    from("seda:rest_upload")
    

    【讨论】:

      猜你喜欢
      • 2022-11-24
      • 1970-01-01
      • 2017-07-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-29
      相关资源
      最近更新 更多