简体   繁体   中英

How to use filters in mule requester module?

I want request files with regex pattern in mule requester. Does anyone know how to do it? https://github.com/mulesoft/mule-module-requester

I know how to request a single file but cant get it for regex filter.

My flow reads a file A_{todaysdatetime}.OUT and generates 3 different files through complex flow logic with each generated file name is in pattern *_{inputfilename}.

Anytime if error happens in flow, i want to move generated files from output to error directory.

With the Mule Requester Module you can set the resource to be a file endpoint like so:

<mulerequester:request config-ref="muleRequesterConfig" resource="myFileEndpoint" doc:name="Mule Requester"/>

Then, within the file endpoint that you've referenced, you can make use of regex filtering:

<file:endpoint name="myFileEndpoint" path="/" connector-ref="myFileConnector" doc:name="File"> 
    <file:filename-regex-filter pattern=" *** insert regex *** " caseSensitive="true"/>
</file:endpoint>

Hope that helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM