When a inbound-endpoint file is received, mule lets us define a regex filter to determine if it's the right file.

<file:inbound-endpoint responseTimeout="10000" doc:name="File" path="${Inbound_Path}" pollingFrequency="${PollingFrequency}" connector-ref="nameConnector">
            <file:filename-regex-filter pattern="BOB\d+\.FILE" caseSensitive="true"/>
        </file:inbound-endpoint>

Is there a similar function or method where we can do the same thing with the mule requester method. We need to import a file in the middle of our flow process, but the file name is not specifically defined. See below for an example for what I am trying to do.

<mulerequester:request config-ref="muleRequesterConfig" resource="file://${Inbound_Path}/<want to add a regex to define the relative file name>?connector=nameConnector" doc:name="Mule Requester"/>

Basically, we do not know the exact file name because the inbound file gets time stamped every time it is stored into the file system. This makes it hard to provide a specific file address to the mule application.

Does anybody know if we can use some similar regex filter function that mirrors the capability of the file:filename-regex-filter for mule requester.

Update - Per Anton's response, I did the following. Created the file:endpoint element outside of the flow.

<file:endpoint doc:name="File" name="File_Name" path="Inbound_Path" responseTimeout="10000" connector-ref="FileConnector"> 
        <file:filename-regex-filter pattern="BOB\d+\.FILE" caseSensitive="true"/>
    </file:endpoint>

Had the resource attribute reference the file:endpoint element

<mulerequester:request config-ref="muleRequesterConfig" resource="File_Name" doc:name="Mule Requester"/>
有帮助吗?

解决方案

You can use a file:endpoint as the resource for mulerequester:request. Just resource="myFileEndpointName".

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top