我有一个像这样的阿帕奇骆驼路线
hosts={"http://localhost:3001","http://localhost:3000"}
String [] hostUris = new String[hosts.length];
for(int i=0;i<hosts.length;i++) {
hostUris[i] = "netty4-http:" + hosts[i];
}
from("direct:a")
.routeId("abc")
.streamCaching()
.onException(RejectedExecutionException.class).handled(true).to("log:com.company.camel.error?level=ERROR&showHeaders=true&showBody=true").end()
.loadBalance().failover(50, false, true)
.to(hostUris)
一切正常,但是最后它向空的http路由之一发送了一个请求。身体可以帮忙吗?
这是生成的xml
<route xmlns="http://camel.apache.org/schema/spring" id="abc" streamCache="true">
<from uri="direct:a"/>
<onException>
<to uri="log:com.company.camel.error?level=ERROR&showHeaders=true&showBody=true"/>
</onException>
<loadBalance inheritErrorHandler="false">
<failover maximumFailoverAttempts="50" roundRobin="true" sticky="false"/>
<to uri="netty4-http:http://localhost:3000"/>
<to uri="netty4-http:http://localhost:3001"/>
</loadBalance>
</route>