1

私は Mule を初めて使用し、interceptor-stack 要素の使用に問題があります。

以下は、こちらのドキュメントからそのまま引用されているようです: http://www.mulesoft.org/documentation/display/33X/Using+Interceptors

<interceptor-stack name="default">
    <logging-interceptor/>
    <timer-interceptor/>
</interceptor-stack>

<flow name="MyFlowFlow1" doc:name="MyFlowFlow1">

    <interceptor-stack ref="default"/>  <!--this is line 15 -->
    <logger level="INFO" message="Got here"/>

</flow>    

しかし、無効であるという例外が発生します。

誰かが私が間違っていることを教えてもらえますか?

org.xml.sax.SAXParseException; lineNumber: 15; columnNumber: 43; cvc-complex-type.2.4.a: Invalid content was found starting with element 'interceptor-stack'. One of '{"http://www.mulesoft.org/schema/mule/core":annotations, "http://www.mulesoft.org/schema/mule/core":description, "http://www.mulesoft.org/schema/mule/core":abstract-message-source, "http://www.mulesoft.org/schema/mule/core":abstract-inbound-endpoint, "http://www.mulesoft.org/schema/mule/core":abstract-message-processor, "http://www.mulesoft.org/schema/mule/core":abstract-outbound-endpoint, "http://www.mulesoft.org/schema/mule/core":abstract-mixed-content-message-processor, "http://www.mulesoft.org/schema/mule/core":response}' is expected.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
...etc...

編集 - これは、以下の応答に対処するためのものです。

この最初のプライベート フローは、flow-ref を介して別のフローから呼び出されると完全に機能します。「ここに着きました」というメッセージとタイミングが表示されます。

<flow name="test2Flow1" doc:name="test2Flow1">
    <timer-interceptor/>
    <logger level="INFO" message="got here" doc:name="Logger"/>
</flow>

ただし、この 2 番目のプライベート フローは、別のフローから呼び出された場合は機能しません。実際、解析も行われません。唯一の違いは、タイマー インターセプターの明示的な使用が、タイマー インターセプターを含むインターセプター スタックへの参照に変更されることです。

<interceptor-stack name="default">
    <timer-interceptor/>
</interceptor-stack>

<flow name="test2Flow1" doc:name="test2Flow1">
    <interceptor-stack ref="default"/>
    <logger level="INFO" message="got here" doc:name="Logger"/>
</flow>
4

3 に答える 3

0

メッセージプロセッサがないため、フローが無効だと思います。

フローの構造を見てみましょう。

http://www.mulesoft.org/documentation/display/current/Using+Flows+for+Service+Orchestration#UsingFlowsforServiceOrchestration-TheAnatomyofaFlow

于 2013-09-05T19:47:29.623 に答える
0

インターセプターは、コンポーネント内で使用するためのものです。
この構成は機能するはずです。

<interceptor-stack name="default">
    <logging-interceptor/>
    <timer-interceptor/>
</interceptor-stack>

<flow name="test2Flow1" doc:name="test2Flow1">
    <pooled-component class="com.MyComponent">
        <interceptor-stack ref="default"/>  <!--this is line 15 -->
    </pooled-component>
    <logger level="INFO" message="Got here"/>
</flow>   
于 2013-09-05T22:13:05.883 に答える
0

メッセージ プロセッサは、フローの最初の項目である必要があります

于 2013-09-05T20:53:21.573 に答える