Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: CAMEL-670

...

And our unit test is tested with this java code. Notice that we expect the Bye World message to be delivered at the 3rd attempt.

Wiki Markup
{snippet:id=e1|lang=java|url=activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JMSTransactionalClientTest.java}
.

Spring based configuration

In Camel 1.4 we have introduced the concept of configuration of the error handlers using spring XML configuration. The sample below demonstrates that you can configure transaction error handlers in Spring XML as spring beans. These can then be set as global, per route based or per policy based error handler. The latter has been demonstrated in the samples above. This sample is the database sample configured in Spring XML.

Notice that we have defnined two error handler, one per route. The first route uses the transaction error handler, and the 2nd uses no error handler at all.

Wiki Markup
{snippet:id=e1|lang=xml|url=activemq/camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/TransactionErrorHandlerBuilderAsSpringBeanTest.xml}

The following snippet is the Spring XML configuration to setup the error handlers in pure spring XML:

Wiki Markup
{snippet:id=e2|lang=xml|url=activemq/camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/TransactionErrorHandlerBuilderAsSpringBeanTest.xml}

See Also

Include Page
CAMEL:Using This Pattern
CAMEL:Using This Pattern