这是路由:
<route>
<from uri="direct:xyz"/>
<loadBalance>
<failover maximumFailoverAttempts="2" roundRobin="false">
<exception>java.net.NoRouteToHostException</exception> </failover>
<to uri="http://URi1"/>
<to uri="http://URi2 "/>
</loadBalance>
当无法建立与URi 1的连接时,我使用URi2。如何显示响应?
发布于 2015-10-07 20:42:51
如果您不想打破当前的模式,我建议您使用故障转移直接端点。免责声明:我通常在DSL中工作,所以语法可能有点问题。
<from uri="direct:xyz">
<loadBalance>
<failover maximumFailoverAttempts="2" roundRobin="false">
<exception>java.net.NoRouteToHostException</exception> </failover>
<to uri="direct:primary"/>
<to uri="direct:secondary"/>
</loadBalance>
</from>
<from uri="direct:primary">
<errorHandler id="noErrorHandler" type="NoErrorHandler"/>
<to uri="http://URi1"/>
//Response handling
</from>
<from uri="direct:secondary">
<errorHandler id="noErrorHandler" type="NoErrorHandler"/>
<to uri="http://URi2"/>
//Response handling
</from>https://stackoverflow.com/questions/32990443
复制相似问题