【问题标题】:WSO2 Default configuration of EndpointsWSO2 端点的默认配置
【发布时间】:2014-01-20 13:37:39
【问题描述】:

我有一个带有内联端点的 wso2 esb 4.7.0 代理和 inline configurations,例如 suspendOnFailuremarkForSuspension

<markForSuspension><errorCodes>-1(永不挂起)对我的所有端点都非常重要。到目前为止,我需要为每个端点复制/粘贴整个配置标签。

如何更改 markForSuspension 的默认值?

这样我就不必再为每个端点提供整个配置了。

<?xml version="1.0" encoding="UTF-8"?>
<proxy>
    <!-- .... -->
            <send>
                <endpoint>
                    <address uri="@@To@@">
                        <timeout>
                           <duration>30000</duration>
                           <responseAction>fault</responseAction>
                        </timeout>
                        <suspendOnFailure>
                            <errorCodes>-1</errorCodes>
                            <initialDuration>0</initialDuration>
                            <progressionFactor>1.0</progressionFactor>
                            <maximumDuration>0</maximumDuration>
                        </suspendOnFailure>
                        <markForSuspension>
                            <errorCodes>-1</errorCodes>
                        </markForSuspension>
                    </address>
                </endpoint>
            </send>
        </inSequence>
    </target>
</proxy>

【问题讨论】:

    标签: wso2 wso2esb endpoint


    【解决方案1】:

    AFAIK,除非您修改代码(并重新编译),否则您无法更改默认值。

    我建议您为端点创建一个template。见Sample 752

    例如,您可以尝试以下配置。

    <proxy xmlns="http://ws.apache.org/ns/synapse"
           name="TestProxy"
           transports="http"
           statistics="enable"
           trace="disable"
           startOnLoad="true">
       <target>
          <inSequence>
    
                <send>
    
                    <endpoint name="ep_name"
                        template="ep_template"
                        uri="@@To@@"/>
    
                </send>
          </inSequence>
          ...
       </target>
    </proxy>
    

    以下是端点的模板

    <template xmlns="http://ws.apache.org/ns/synapse" name="ep_template">
       <endpoint name="$name">
          <address uri="$uri">
                <timeout>
                   <duration>30000</duration>
                   <responseAction>fault</responseAction>
                </timeout>
                <suspendOnFailure>
                    <errorCodes>-1</errorCodes>
                    <initialDuration>0</initialDuration>
                    <progressionFactor>1.0</progressionFactor>
                    <maximumDuration>0</maximumDuration>
                </suspendOnFailure>
                <markForSuspension>
                    <errorCodes>-1</errorCodes>
                </markForSuspension>
          </address>
       </endpoint>
    </template>
    

    希望对你有帮助

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-07
      • 2019-12-03
      • 2019-07-25
      • 1970-01-01
      • 2018-05-05
      相关资源
      最近更新 更多