0
votes

I have a question about MSMQ. If I use a non-transactional queue and send message to it with recoverable parameter, message is stored on disc and in case of some problem secure. But if I want pull message from non-transactional queue, is there some mechanism to secure messages to stay in queue in case of some problem (server error, db off...)?

For some reasons I don't want to use transactional queue. Thanks a lot for response.

1

1 Answers

0
votes

You could implement a peek-then-receive process to simulate a transaction.

  1. Peek message to get content.
  2. Use the content as you wish.
  3. If step 2 completes then Receive message to effectively delete it.
  4. If step 2 fails, execute cleanup code and goto step 1.