0

My ESB flow needs to get files from a dynamic folder. This folder name changes based on month and year. Hence, I configured my inbound-endpoint as shown below but I am getting below error. I really appreciate any help on this.

Flow:

<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>

Error:

org.mule.api.endpoint.MalformedEndpointException: The endpoint "file:///C:/#[new Date().format('yyyy/MMMM')]" is malformed and cannot be parsed. If this is the name of a global endpoint, check the name is correct, that the endpoint exists, and that you are using the correct configuration (eg the "ref" attribute). Note that names on inbound and outbound endpoints cannot be used to send or receive messages; use a named global endpoint instead.. Only Outbound endpoints can be dynamic

Philip Allgaier
  • 3,505
  • 2
  • 26
  • 53
Kgan
  • 35
  • 2
  • 12

1 Answers1

0

"Only Outbound endpoints can be dynamic" quite says it all. You can have a look at the Mule Requester Module if it suits your needs, or try creating endpoints/flows programmatically with a scheduler and Java/Groovy/etc code.

Anton Kupias
  • 3,945
  • 3
  • 16
  • 20
  • Thanks for your response! I tried this groovy expression as well (path="C:\#[groovy:new Date().format('yyyy\\MMMM')]") but it didn't work. I believe if we use "Mule Requester Module" we need to explicitly trigger the flow but here the polling needs to be automatic. – Kgan Apr 07 '14 at 18:56