camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From benshort <...@benshort.co.uk>
Subject JMS Transactions
Date Wed, 04 Feb 2009 14:58:51 GMT

Hi, 

I have the following route...

from("jms:rts_messages_email?concurrentConsumers=1")
                        .process(new SendingProcessor())

                        .onException(Exception.class)
                            .handled(true)
                            .maximumRedeliveries(0)
                            .process(new SendFailedProcessor())
                            .to("jms:message_status", "jms:failed_messages")
                            .end()

                        .to("jms:message_status", smtp)
                            .process(new SentProcessor())
                            .to("jms:message_status");

Errors while sending the smtp will be caught and sent to jms:message_status
and jms:failed_messages.

jms:message_status is used to log out the send attempts. jms:failed_messages
is a queue of failed messages that are processed to decide if they should be
retried or not.

Now what I would like to do is make the shown route transactional. So the
message is not removed from jms:rts_messages_email until it has been added
to jms:message_status and jms:failed_messages in the case of an error or
jms:message_status in the case of no error.

I want to do this so that if the application dies while the message is
trying to be sent it will still be in the jms:rts_messages_email jms queue.
and next time the application is started it will be pulled out and retried.

Is this possible?

Ben
-- 
View this message in context: http://www.nabble.com/JMS-Transactions-tp21832102s22882p21832102.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message