I am considering using Service Broker for messaging between two .NET apps, where one app needs to reliably send messages to the other. I have a pretty good idea on how this looks at the initiator side.
However, the consumer app needs to load messages from the queue, do some processing, and then acknowledge that processing went well. The processing might fail, in which case I need to retry the message. I would also need to keep all messages that has been processed for history purposes.
As far as I can tell, the message is removed from the queue when I do a RECEIVE. So what should the consumer app do in case of a failure ? Push the message onto the queue again ? Can I mark a message as "in processing" and then remove it once my task completed successfully ?
How would I model this using Service Broker ?