blob: 373bf1675fdc4be05bf2fd2950481d5b216707bd [file] [log] [blame]
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
">
<routeContext id="routes-load-balancer" xmlns="http://camel.apache.org/schema/spring">
<route id="sendMessage">
<from uri="timer://org.apache.camel.example.loadbalancer?period=2000"/>
<bean ref="generator" method="createReport"/>
<to uri="direct:loadbalance"/>
</route>
<!-- use failover load balancer in round robin mode, to automatic failover to next server
in case of failure -->
<route id="loadbalancer">
<from uri="direct:loadbalance"/>
<loadBalance inheritErrorHandler="false">
<failoverLoadBalancer roundRobin="true"/>
<to uri="mina:tcp://localhost:9991?sync=true"/>
<to uri="mina:tcp://localhost:9992?sync=true"/>
</loadBalance>
<log message="${body}"/>
</route>
</routeContext>
</beans>