【问题标题】:Mule - Dynamic Path - File componentMule - 动态路径 - 文件组件
【发布时间】:2016-02-11 14:48:44
【问题描述】:

我在我的mule flow 中使用file component,在该文件中添加payload。 骡流是:

HTTP Listener => Payload => File => ...

XML 中的组件:

    <file:outbound-endpoint path="${test}" outputPattern="tested_#[function:datestamp:yyyyMMdd].log" connector-ref="File" responseTimeout="1000" doc:name="File"/>

当我生成文件时,它会在mule-esb-directory\bin 中创建一个名为test 的文件夹,但我想在项目目录中创建它,例如: mule-esb-directory\app\MyMuleProject.

我使用properties file 设置路径,但它不起作用。

现在: mule-esb-directory\bin\test

我想要: mule-esb-directory\app\MymuleProject

【问题讨论】:

    标签: file path mule payload


    【解决方案1】:

    试试这个

    src/main/resources/
    

    或者尝试使用绝对路径,像这样

    /opt/mule-esb-directory/app/MymuleProject
    

    【讨论】:

    • 我试过了,但它的创建是这样的:mule-esb-directory\bin\src\main\resources
    • 在运行时,根文件夹与项目所在的位置相同(假设您有一个项目)。理论上,你可以试试这个&lt;file:outbound-endpoint path="/" outputPattern="tested_#[function:datestamp:yyyyMMdd].log" responseTimeout="10000" doc:name="File"/&gt;但是文件连接器不允许,那么你可以这样做:&lt;file:outbound-endpoint path="../#[app.name]" outputPattern="tested_#[function:datestamp:yyyyMMdd].log" responseTimeout="10000" doc:name="File"/&gt;我不认为这是最好的做法,但它有效。
    • 谢谢!我use ../apps/#[app.name]/errors 它工作正常
    猜你喜欢
    • 2014-01-10
    • 1970-01-01
    • 2021-06-24
    • 2018-02-09
    • 1970-01-01
    • 2018-07-15
    • 1970-01-01
    • 1970-01-01
    • 2018-03-08
    相关资源
    最近更新 更多