Claus, I am using persistent queues, but I purge them prior to each test.
I've rerun this test multiple times and it does deliver the correct number if no exceptions are thrown. Its only when the exception handling kicks in that I end up with duplicates being delivered.
Any other thoughts on this? What happens exactly when an exception is thrown in a transacted route?
Can someone verify if this scenario is correct?
flow w/o exception...
-message sent to InboundQ (external process)
-message received by Processor1 and marked as sent/waiting for ACK in InboundQ
-message received by Processor2
-message sent to finishedQueue
-ACK sent back to InboundMessage queue
-message is removed from InboundQ
flow w/exception...
-message sent to InboundQ (external process)
-message received by Processor1 and marked as sent/waiting for ACK in InboundQ
-message received by Processor2, then throws an Exception
-onException clause kicks in and retries Processor2 (up to 3 times)
-if success, message sent to finishedQueue, ACK sent back to InboundQ
-if 3 failures reached, message sent to errorQueue, ACK send back to InboundQ
-message is removed from InboundQ
Also, I've read that this can also be accomplished using CLIENT_ACKNOWLEDGE mode instead of transactions. I'm yet to find a Camel routing example of doing this. Can someone point me to a unit test that does this? How do I explicitly ACK back at the end of my route to control this??
thanks in advance...
Claus Ibsen-2 wrote:
Hi
Do you use persistent queues? Then make sure the queues are empty when
testing. Maybe deleting the AMQ data folder before testing.
Ben - Senior Consultant
using SMX 3.3.1/Camel 2.1