Apache camel Load Balance

负载均衡

xml 写道
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:camel="http://cxf.apache.org/transports/camel"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/transports/camel http://cxf.apache.org/transports/
camel.xsd
http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/
cxfEndpoint.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/
camel-spring.xsd
">
<!-- Enable bridge between Camel Property Placeholder and Spring Property
placeholder so we can use system properties
to dynamically set the port number for unit testing the example. -->
<bean id="bridgePropertyPlaceholder"
class="org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer"/>
<bean id = "roundRobinRef"
class="org.apache.camel.processor.loadbalancer.RoundRobinLoadBalancer" />
<camelContext id="dest_context" xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="jetty:http://localhost:{{port}}/GreeterContext/GreeterPort"/>
<loadBalance ref="roundRobinRef">
<to uri="direct:EndpointA"/>
<to uri="direct:EndpointB"/>
</loadBalance>
</route>
</camelContext>
<!-- Inject the camel context to the Camel transport's destination -->
<camel:destination name="{http://apache.org/
hello_world_soap_http}CamelPort.camel-destination">
<camel:camelContextRef>dest_context</camel:camelContextRef>
</camel:destination>
</beans>

猜你喜欢

转载自justice-jl.iteye.com/blog/1770747