Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Using the Spring configuration

Code Block
languagexml

<bean id = "roundRobinRef" class="org.apache.camel.processor.loadbalancer.RoundRobinLoadBalancer" />
  <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
    <route>
      <from uri="direct:start"/>
      <loadBalance ref="roundRobinRef">
          <to uri="mock:x"/>        
          <to uri="mock:y"/>       
          <to uri="mock:z"/>          
      </loadBalance>
    </route>
  </camelContext>
Wiki Markup
{snippet:id=example|lang=xml|url=activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/loadBalance.xml}

or

Code Block
languagexml
<camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
  <route>
    <from uri="direct:start"/>
    <loadBalance>        
        <roundRobin/>  <!-- This only support for Camel 1.5 -->
        <to uri="mock:x"/>        
        <to uri="mock:y"/>       
        <to uri="mock:z"/>
        <roundRobin/>          
    </loadBalance>
  </route>
</camelContext>

...