在JBoss Fuse 6.2.1 Apache 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}}">我知道错误:
由:cvc: cvc-datatype-valid.1.2.1:'{{roamware.senderservice.maximumFailoverAttempts}}‘引起,它不是整数的有效值。
如果我尝试使用http://camel.apache.org/using-propertyplaceholder.html中的“对XML中的任何类型的属性使用属性占位符”,如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- to .3.2.2:属性'prop:maximumFailoverAttempts‘引起的,不允许出现在元素“故障转移”中。
我们正在使用其他骆驼属性,并在配置文件中设置该属性。如何为maximumFailoverAttempts属性使用参数?
发布于 2016-05-31 06:11:12
是的,这在负载平衡器上不支持。我已经登录了一张票,以便在将来的Camel发行版中得到支持:https://issues.apache.org/jira/browse/CAMEL-10001
https://stackoverflow.com/questions/37535150
复制相似问题