无法在mule中转换http响应

时间:2015-03-01 11:45:23

标签: mule mule-component

我有一个叫做oozies的骡子工作流程' http服务启动一个工作,但我需要存储oozie在数据库中给出的工作ID。我实现了这个,但是一旦我转换了Oozie的响应,我就得到了一个例外。

无法应用转化。 Payload是ReleasingInputStream。

<mule 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://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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"
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/test http://www.mulesoft.org/schema/mule/test/3.6/mule-test.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.6/mule.xsd
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/3.6/mule-vm.xsd
http://www.mulesoft.org/schema/mule/http http://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"
    version="EE-3.5.2">
<object-to-string-transformer name="httptoobj" />
            <http:http-response-to-object-transformer name="httptostring" />

<flow name="polling" doc:name="polling">
    <quartz:inbound-endpoint repeatInterval="3000"
        startDelay="3000" jobName="couchbasePoller" doc:name="Quartz">
        <quartz:event-generator-job />
    </quartz:inbound-endpoint>
    <component doc:name="Java">
        <singleton-object
            class="com.xyz.alertcampaign.appworkflow.CouchbasePoller" />
    </component>

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

</flow>
<flow name="oozie-workflow-manager" doc:name="oozie-workflow-manager">
    <vm:inbound-endpoint exchange-pattern="request-response"
        path="oozieQueue" doc:name="VM" />
    <http:outbound-endpoint exchange-pattern="request-response"  address="http://localhost:8080" responseTransformer-refs="httptostring"    doc:name="HTTP" />  

        <object-to-string-transformer />
    <component doc:name="Java">
        <singleton-object
            class="com.xyz.alertcampaign.appworkflow.JobUpdater" />
    </component>
</flow>

1 个答案:

答案 0 :(得分:1)

您正在将输入流应用于字符串变换器两次:

responseTransformer-refs="httptostring"

在这里

<object-to-string-transformer />

另外我猜你有一个名为httptostring的错误转换器。删除它或只删除responseTransformer-refs