Versions Compared

Key

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

...

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

You can specify multiple exceptions to failover as the option is varargs, for instance:

Code Block
java
java

loadBalance().failOver(IOException.class, MyOtherException.class).to("direct:a", "direct:b");

Using failover in Spring DSL

Failover can also be used from Spring DSL and you configure it as:

Code Block
xml
xml

      <loadBalance>
          <failOver>
              <exception>java.io.IOException</exception>
              <exception>com.mycompany.MyOtherException</exception>
          </failOver>
          <to uri="direct:a"/>
          <to uri="direct:b"/>
      </loadBalance>
Include Page
CAMEL:Using This Pattern
CAMEL:Using This Pattern