Will XA and the setup I have also affect how erroHandling is done?

This:

errorHandler(loggingErrorHandler());
from("jms:queue:foobar").to("bean:updateService");

will try to deliver 5 times and then log and throw the message away.

This:

from("jms:queue:foobar").errorHandler(deadLetterChannel("jms:queue:DLQ")).to("bean:updateService");

tries to deliver 5 times then sends the message to the DQL jms queue.

But this:

errorHandler(deadLetterChannel("jms:queue:DLQ"));
from("jms:queue:foobar").to("bean:updateService");

tries to deliver 5 times, then throws the message away.. nothing is on the
dql. Why?

(bean:updateService throws a runtimeexception every time called).

So I guess my question really is how messages are put on the DLQ in the
example above, when using XA. Message is read, delivered, delivery failed,
transactoin rollback. New transaction, message is read, put on the DQL, and
commit. Or what? And then why isn't the global errorhandler inherited in the
last example?

Thanks,

/Magnus

Reply via email to