【问题标题】:MuleRequester deleting file after readingMuleRequester 读取后删除文件
【发布时间】:2015-05-05 20:52:29
【问题描述】:

以下是我的骡子配置。

<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:quartz="http://www.mulesoft.org/schema/mule/quartz" xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:vm="http://www.mulesoft.org/schema/mule/vm" xmlns:test="http://www.mulesoft.org/schema/mule/test"
xmlns:file="http://www.mulesoft.org/schema/mule/file"
xmlns:mulerequester="http://www.mulesoft.org/schema/mule/mulerequester"
xsi:schemaLocation="http://www.mulesoft.org/schema/mule/quartz http://www.mulesoft.org/schema/mule/quartz/current/mule-quartz.xsd

http://www.mulesoft.org/schema/mule/testhttp://www.mulesoft.org/schema/mule/test/3.6/mule-test.xsd http://www.mulesoft.org/schema/mule/corehttp://www.mulesoft.org/schema/mule/core/3.6/mule.xsd http://www.mulesoft.org/schema/mule/vmhttp://www.mulesoft.org/schema/mule/vm/3.6/mule-vm.xsd http://www.mulesoft.org/schema/mule/httphttp://www.mulesoft.org/schema/mule/http/3.6/mule-http.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd http://www.mulesoft.org/schema/mule/mulerequesterhttp://www.mulesoft.org/schema/mule/mulerequester/1.0-SNAPSHOT/mule-mulerequester.xsd http://www.mulesoft.org/schema/mule/filehttp://www.mulesoft.org/schema/mule/file/3.6/mule-file.xsd">

    <vm:outbound-endpoint exchange-pattern="one-way"
        path="oozieQueue" doc:name="Trigger workflow" />

</flow>
<flow name="oozie-workflow-manager" doc:name="oozie-workflow-manager">
    <vm:inbound-endpoint exchange-pattern="one-way"
        path="oozieQueue" doc:name="VM" />

    <foreach collection="#[payload.items()]" counterVariableName="counter">
        <choice doc:name="Choice">
            <when expression="#[payload.status == CampaignStatus.NOT_STARTED]">
                <mulerequester:request config-ref="Mule_Requester"
                    resource="file://#[payload.fileName]" returnClass="java.lang.String"  doc:name="Request a message from a queue" />
                <logger level="ERROR" message="Payload is : #[message.payload]" />
                <enricher  target="#[variable:jsonResponse]">                   
                    <http:outbound-endpoint exchange-pattern="request-response"
                        address="http://abc.xyz.com:11000/oozie/v2/jobs?action=start"
                         method="POST" doc:name="HTTP"
                        contentType="application/xml;charset=UTF-8" />
                </enricher>
                <choice doc:name="Choice">
                    <when expression="#[message.inboundProperties['http.status'] == 201]">
                        <component doc:name="Java">
                            <singleton-object
                                class="com.xyz.alertcampaign.appworkflow.JobUpdater" />
                        </component>
                    </when>
                    <otherwise>
                        <logger level="ERROR" message="Error occurred on creating Job in OOzie " />
                    </otherwise>
                </choice>
            </when>
            <when
                expression="#[payload.status == CampaignStatus.UPDATED || payload.status == CampaignStatus.EXPIRED]">
                <logger level="ERROR" message="#[payload.status]" />
                <http:outbound-endpoint exchange-pattern="request-response"
                    method="PUT"
                    address="http://localhost:8080/oozie/v1/job/#[payload.jobId]?action=kill"
                    responseTransformer-refs="httptoobj" doc:name="HTTP" />
                <choice doc:name="Choice">
                    <when expression="#[message.inboundProperties['http.status'] == 200]">
                        <component doc:name="Java">
                            <singleton-object
                                class="com.xyx.alertcampaign.appworkflow.JobUpdater" />
                        </component>
                    </when>
                    <otherwise>
                        <logger level="ERROR" message="Error occurred on killing Job in OOzie " />
                    </otherwise>
                </choice>
            </when>
        </choice>
    </foreach>
</flow>

我有一个文件路径的符号链接。但是在 MuleRequester 完成后,符号链接和文件都会被删除。

【问题讨论】:

    标签: mule mule-component


    【解决方案1】:

    尝试将resource url 设置为 file://#[payload.fileName]?autoDelete=false

    【讨论】:

    • 非常感谢工作。 MuleRequester 的文档需要更新。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-02
    • 1970-01-01
    • 2022-12-13
    • 1970-01-01
    • 1970-01-01
    • 2021-01-26
    相关资源
    最近更新 更多