Camel loadBalance故障转移maximumFailoverAttempts不支持属性

时间:2016-05-31 00:29:14

标签: apache-camel

在JBoss Fuse 6.2.1 Apache Camel 2.15.1上,当我有......

<loadBalance inheritErrorHandler="false" id="load-balance">
<failover maximumFailoverAttempts="2">
    <exception>java.net.ConnectException</exception>
    <exception>org.apache.cxf.transport.http.HTTPException</exception>
</failover>
<to id="sender-service1" uri="cxf:bean:sender-service1-endpoint" />
<to id="sender-service2" uri="cxf:bean:sender-service2-endpoint" />

它有效,但是当我尝试使用参数来实现maximumFailoverAttempts时,例如

<failover maximumFailoverAttempts="{{senderservice.maximumFailoverAttempts}}">

我收到错误:

  

引起:org.xml.sax.SAXParseException:cvc-datatype-valid.1.2.1:&#39; {{roamware.senderservice.maximumFailoverAttempts}}&#39;不是&#39;整数&#39;的有效值。

如果我尝试使用&#34;对XML DSL中的任何类型的属性使用属性占位符&#34;来自http://camel.apache.org/using-propertyplaceholder.html中描述的Validation error with integer property (camel),例如

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:camel="http://camel.apache.org/schema/spring" xmlns:context="http://www.springframework.org/schema/context"
xmlns:prop="http://camel.apache.org/schema/placeholder"

    <failover prop:maximumFailoverAttempts="{{senderservice.maximumFailoverAttempts}}">

然后我得到错误:

  

引起:org.xml.sax.SAXParseException:cvc-complex-type.3.2.2:Attribute&#39; prop:maximumFailoverAttempts&#39;不允许出现在元素&#39;故障转移&#39;。

我们正在使用其他Camel属性,并且在我们的配置文件中设置了该属性。如何为maximumFailoverAttempts属性使用参数?

1 个答案:

答案 0 :(得分:0)

是的,负载均衡器不支持此功能。我已经记录了一张票,以便在未来的Camel版本中获得此支持:https://issues.apache.org/jira/browse/CAMEL-10001

相关问题