【问题标题】:Mule - Retry connection with basic flowMule - 使用基本流程重试连接
【发布时间】:2015-06-01 11:08:08
【问题描述】:

我有一个基本的骡流程:

HTTP => SOAP => JAVA CLASS

<mule xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
    xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.6.1"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd">
    <http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>
    <flow name="test_dynamicsFlow">
        <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
        <cxf:jaxws-service doc:name="CXF"/>
        <component doc:name="Java"/>
    </flow>
</mule>

我想用超时与 SOAP 建立一个重试连接,但我不知道是否可行。

我一直在寻找错误处理连接器

我应该使用这些连接器来做到这一点还是如何实现它?

【问题讨论】:

    标签: java http soap exception-handling mule


    【解决方案1】:

    您需要使用until-successful 范围包装您的HTTP 调用。

    例子:

    <until-successful objectStore-ref="objectStore" maxRetries="5" secondsBetweenRetries="60" >
        <http:request config-ref="HTTP_Request_Configuration" path="submit" method="POST" />
    </until-successful>
    

    参考:https://developer.mulesoft.com/docs/display/current/Until+Successful+Scope

    【讨论】:

    • 用这个解决方案可以回信吗?
    • 在同步模式下:是的。
    • 谢谢大卫。是的,我有这个选项,但我想返回一个个性化的 XML 消息。我需要创建一个新的 Java 类吗?我想我也需要这个:deadLetterQueue-ref
    • 最后,我使用 until-successful 范围和 java 组件:&lt;until-successful maxRetries="3" secondsBetweenRetries="60" doc:name="Until Successful" synchronous="true"&gt; &lt;component doc:name="Java"&gt; &lt;spring-object bean="testIntegration" /&gt; &lt;/component&gt; &lt;/until-successful&gt; 但它返回错误:Exception thrown inside until-successful org.mule.component.ComponentException: Component that caused exception is: DefaultJavaComponent{Flow_test.component.1805940825}. Message payload is of type: String
    • 请开一个新问题,cmets 不是跟进的地方。
    猜你喜欢
    • 1970-01-01
    • 2015-06-08
    • 1970-01-01
    • 2014-09-30
    • 2017-04-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多