Author: buildbot Date: Sun Apr 13 16:19:04 2014 New Revision: 906034 Log: Production update by buildbot for camel
Modified: websites/production/camel/content/cache/main.pageCache websites/production/camel/content/load-balancer.html Modified: websites/production/camel/content/cache/main.pageCache ============================================================================== Binary files - no diff available. Modified: websites/production/camel/content/load-balancer.html ============================================================================== --- websites/production/camel/content/load-balancer.html (original) +++ websites/production/camel/content/load-balancer.html Sun Apr 13 16:19:04 2014 @@ -301,24 +301,25 @@ public static class MyLoadBalancer exten } } ]]></script> -</div></div><h3 id="LoadBalancer-CircuitBreaker">Circuit Breaker</h3><p>The Circuit Breaker load balancer is a stateful pattern that monitors all calls for certain exceptions. Initially the Circuit Breaker is in closed state and passes all messages. If the are failures and the threshold is reached, it moves to open state and rejects all calls until halfOpenAfter timeout is reached. After this timeout is reached, if there is a new call, it will be passed and if the result is success the Circuit Breaker will move closed state, or to open state if there was an error.</p><p>An example using Java DSL:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><h3 id="LoadBalancer-CircuitBreaker">Circuit Breaker</h3><p>The Circuit Breaker load balancer is a stateful pattern that monitors all calls for certain exceptions. Initially the Circuit Breaker is in closed state and passes all messages. If the are failures and the threshold is reached, it moves to open state and rejects all calls until halfOpenAfter timeout is reached. After this timeout is reached, if there is a new call, it will pass and if the result is success the Circuit Breaker will move to closed state, or to open state if there was an error.</p><p>An example using Java DSL:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[from("direct:start").loadBalance() - .circuitBreaker(2, 1000L, MyExceptionProcessor.class) + .circuitBreaker(2, 1000L, MyCustomException.class) .to("mock:result"); ]]></script> </div></div><p>And the same example using Spring XML:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"> - <route> + <route> <from uri="direct:start"/> - <loadBalance> - <circuitBreaker threshold="2" halfOpenAfter="1000L"/> - <exception>MyExceptionProcessor</exception> - <to uri="mock:result"/> + <loadBalance> + <circuitBreaker threshold="2" halfOpenAfter="1000"> + <exception>MyCustomException</exception> + </circuitBreaker> + <to uri="mock:result"/> </loadBalance> - </route> +</route> </camelContext> ]]></script> -</div></div><p>The above example loads balance requests from <strong><a shape="rect" class="external-link" href="http://directstart" rel="nofollow">direct:start</a></strong> to one of the available <strong>mock endpoint</strong> instances, in this case using a round robin policy.<br clear="none"> For further examples of this pattern look at <a shape="rect" class="external-link" href="http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RoundRobinLoadBalanceTest.java?view=markup">this junit test case</a></p><p></p><h4 id="LoadBalancer-UsingThisPattern">Using This Pattern</h4> +</div></div><p>For further examples of this pattern look at <a shape="rect" class="external-link" href="http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RoundRobinLoadBalanceTest.java?view=markup">this junit test case</a></p><p></p><h4 id="LoadBalancer-UsingThisPattern">Using This Pattern</h4> <p>If you would like to use this EIP Pattern then please read the <a shape="rect" href="getting-started.html">Getting Started</a>, you may also find the <a shape="rect" href="architecture.html">Architecture</a> useful particularly the description of <a shape="rect" href="endpoint.html">Endpoint</a> and <a shape="rect" href="uris.html">URIs</a>. Then you could try out some of the <a shape="rect" href="examples.html">Examples</a> first before trying this pattern out.</p></div> </td>