...
That is all that is needed to configure a Camel route as being transacted. Just remember to use the transacted DSL. The rest is standard Spring XML to setup the transaction manager.
See Also
Camel 2.0 - JMS Sample
In this sample we want to listen for messages on a queue and process the messages with our business logic java code and send them along. Since its based on a unit test the destination is a mock endpoint.
First we configure the standard Spring XML to declare a JMS connection factory, a JMS transaction manager and our ActiveMQ component that we use in our routing.
Wiki Markup |
---|
{snippet:id=e1|lang=xml|url=camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/TransactionMinimalConfigurationTest.xml} |
And then we configure our routes. Notice that all we have to do is mark the route as transacted using the transacted tag.
Wiki Markup |
---|
{snippet:id=e2|lang=xml|url=camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/TransactionMinimalConfigurationTest.xml} |
Tip | ||
---|---|---|
| ||
When a route is marked as transacted using transacted Camel will automatic use the |
See Also
- Error handling in Camel
- Error Handler
- JMS
- JMS
- Dead Letter Channel
- Error Handler
Include Page CAMEL:Using This Pattern CAMEL:Using This Pattern