apache骆驼使用负载均衡器后发送空消息

时间:2019-06-25 08:35:40

标签: apache-camel

我有一个像这样的阿帕奇骆驼路线

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路由之一发送了一个请求。身体可以帮忙吗?

这是我的踪迹 enter image description here

这是生成的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&amp;showHeaders=true&amp;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>

0 个答案:

没有答案
相关问题