【问题标题】:Mule - Dynamic file inbound endpoint errorMule - 动态文件入站端点错误
【发布时间】:2014-04-07 14:22:52
【问题描述】:

我的 ESB 流程需要从动态文件夹中获取文件。此文件夹名称会根据月份和年份而变化。因此,我如下所示配置了入站端点,但我遇到了错误。我非常感谢您对此提供的任何帮助。

流程:

<flow name="DataMapperTestFlow" doc:name="DataMapperTestFlow">
    <file:inbound-endpoint path="C:\#[new Date().format('yyyy\\MMMM')]" moveToDirectory="C:\#[new Date().format('yyyy\\MMMM')]\backup" pollingFrequency="10000" responseTimeout="10000" doc:name="File">
        <file:filename-regex-filter pattern=".*.xls" caseSensitive="true"/>
    </file:inbound-endpoint>
    <custom-transformer class="ExcelToJava" doc:name="Java"/>
    <jdbc-ee:outbound-endpoint exchange-pattern="one-way" queryKey="insertTestHeaders" connector-ref="NewDatabase" doc:name="InsertHeaders"/>
    <set-payload value="#[payload.excelData.excelRows]" doc:name="Set Payload"/>
    <jdbc-ee:outbound-endpoint exchange-pattern="one-way" queryKey="insertTestRows" connector-ref="NewDatabase" doc:name="InsertRows"/>
</flow>

错误:

org.mule.api.endpoint.MalformedEndpointException:端点 “file:///C:/#[new Date().format('yyyy/MMMM')]”格式错误,不能 被解析。如果这是全局端点的名称,请检查名称 是正确的,端点存在,并且您正在使用 正确的配置(例如“ref”属性)。注意上面的名字 入站和出站端点不能用于发送或接收 消息;改用命名的全局端点..仅出站 端点可以是动态的

【问题讨论】:

    标签: file dynamic mule endpoint inbound


    【解决方案1】:

    “只有出站端点可以是动态的”完全说明了一切。您可以查看Mule Requester Module,如果它适合您的需要,或者尝试使用调度程序和 Java/Groovy/etc 代码以编程方式创建端点/流。

    【讨论】:

    • 感谢您的回复!我也尝试了这个 groovy 表达式 (path="C:\#[groovy:new Date().format('yyyy\\MMMM')]") 但它没有用。我相信如果我们使用“Mule Requester Module”,我们需要明确触发流程,但这里的轮询需要是自动的。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-04-15
    相关资源
    最近更新 更多