2

In a flow something like below:

<flow name="fileFlow">
    <file:inbound-endpoint path="/inbound/ftp/sbc" pollingFrequency="30000" fileAge="30000" moveToDirectory="/inbound/ftp/sbc/archive">
        <file:filename-wildcard-filter pattern="*.xml" caseSensitive="false"/>
    </file:inbound-endpoint>
    <logger message="Entering #[flow.name] flow" level="INFO"/>
    <component class="com.abc.RequestFile"/>
    <logger message="Payload after transformation is: #[payload] flow" level="INFO"/>
     <vm:outbound-endpoint path="merge" />  
    <logger message="Exiting #[flow.name] flow" level="INFO"/>
</flow>

I get InputStream from file:inbound-endpoint which is passed to RequestFile component. This component is required to return a list of files of which one of this is the original one read and passed. I am seeking a solution other than manual copying InputStream to File in java component.

4

1 回答 1

6

如本答案https://stackoverflow.com/a/12397775/387927中所述,您可以java.io.File使用以下设置获取对象而不是其内容:

<file:connector name="fileConnector" streaming="false" autoDelete="false">
    <service-overrides messageFactory="org.mule.transport.file.FileMuleMessageFactory" />
</file:connector>

请注意,您可以在开始之前或完成处理后移动/删除文件,否则 Mule 会一次又一次地轮询它。

于 2013-09-13T17:03:15.863 回答