Versions Compared

Key

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

...

Wiki Markup
{snippet:id=example|lang=java|url=activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/LoadBalanceTest.java}

*Using the Spring configuration

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>
        <to uri="mock:x"/>        
        <to uri="mock:y"/>       
        <to uri="mock:z"/>
        <roundRobin/>          
    </loadBalance>
  </route>
</camelContext>

So the above example will load balance requests from direct:start to one of the available mock endpoint instances, in this case using a round robbin policy.
For further examples of this pattern in use you could look at the junit test case

...