You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Load Balancer

The Load Balancer Pattern allows you to delegate to one of a number of endpoints using a variety of different load balancing policies.

Using the Fluent Builders

from("cxf:bean:routerEndpoint").
  loadBalance().roundRobin().
  to("cxf:bean:serviceEndpoint1", "cxf:bean:serviceEndpoint2", "cxf:bean:serviceEndpoint3");

So the above example will load balance requests from cxf:bean:routerEndpoint to one of the available serviceEndpoint 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

Using This Pattern

If you would like to use this EIP Pattern then please read the Getting Started, you may also find the Architecture useful particularly the description of Endpoint and URIs. Then you could try out some of the Examples first before trying this pattern out.

  • No labels