Hi camel-riders,

Happy New Year!

In our application we have a lot of routes that follow the same pattern:
read a message, do some processing, update/insert in the database and then
send a message to the next route.

You can see an example here:

<route id="div-validate-line">
<from uri="activemq:div.line"/>
<bean ref="divServiceActivator" method="validateDivLine"/>
<choice>
<when>
<simple>${header.lineValidationResponse} == 'VALID'</simple>
<bean ref="divServiceActivator" method="persistDivVehicle"/>
</when>
</choice>
<to uri="activemq:div.line.processed"/>
</route>

Coming from the web-applications world we all thought that we would need XA
transactions to make sure we never lose messages (or lines in the example
above).

Working with Camel the last few months (JBoss Fuse 6.0 in particular) we
found that it's not easy setting up a transaction manager : Aries, bundled
with JBoss Fuse, doesn't support pooled XA resources and we can't seem to
get Atomikos working in Fuse.

So we took a step back and asked whether we even need XA transactions. Couldn't
we just define an errorhandler that requeues the message and after x
attempts sends it to a dead letter queue? That way the transactionmanager
will rollback everything that was done in the database (in the
persisDivVehicle method in the above example) and we don't lose any lines.

So the question is: do we need XA transactions or can we ensure that we
don't lose messages by some usage op errorhandler and/or properties on the
route or endpoints?

Thanks in advance for your feedback.

Cheers,
Tom

Reply via email to