Advice: Transaction Processing using MSMQ
-
Hi I am currently working on a solution for the asynchronous processing of xml messages. The solution broadly works as follows: 1. Xml Messages are passed to me via a Web Service (volumes of around a few 100 per day). 2. The Web service posts each Xml message onto a private message Queue (MSMQ). 3. A 'listening' / 'polling' windoes service retrieves messages from the message queue and routes them for onward processing (this could be transforming / appending the XML before passing to an external web service) or simply saving the message in a local DB). My query surrounds the most appropriate approach for dealing with failures during the processing stage. Ideally I'd like any messages that fail due to particular handled errors ( web service unavaible ect) to be returned to the message queue and retried later, but having read a little regarding transactions I am unsure as to the most effecticent and appropriate mechansism for carrying this out. I could just programatically add the item backl to the top of the queue, or wrap the processing code in a DTS transaction. I can see that MSMQ supports its own transactions too, but all the examples seem to relate to wrapping the "send" in a transaction rather than dealing with an item taken from the queue. if anyone has some relevant experience that they can bring to bear on this, I would be v grateful. cheers