title: How do I handle message failure in MSMQ bindings for WCF
body: <p>I have create a WCF service and am utilising netMsmqBinding binding.</p>
  <p>This is a simple service that passes a Dto to my service method and does not expect a response. The message is placed in an MSMQ, and once picked up inserted into a database.</p>
  <p>What is the best method to make sure no data is being lost.</p>
  <p>I have tried the 2 following methods:</p>
  <ol>
  <li><p>Throw an exception</p>
  <p>This places the message in a dead letter queue for manual perusal. I can process this when my strvice starts</p>
  </li>
  <li><p>set the receiveRetryCount=&quot;3&quot; on the binding</p>
  <p>After 3 tries - which happen instantanously, this seems to leave the message in queue, but fault my service. Restarting my service repeats this process.</p>
  </li>
  </ol>
  <p>Ideally I would like to do the follow:</p>
  <p>Try process the message</p>
  <ul>
  <li>If this fails, wait 5 minutes for that message and try again.</li>
  <li>If that process fails 3 times, move the message to a dead letter queue.</li>
  <li>Restarting the service will push all messages from the dead letter queue back into the queue so that it can be processed.</li>
  </ul>
  <p>Can I achieve this? If so how?
  Can you point me to any good articles on how best to utilize WCF and MSMQ for my given sceneria.</p>
  <p>Any help would be much appreciated. Thanks!</p>
  <p><strong>Some additional information</strong></p>
  <p>I am using MSMQ 3.0 on Windows XP and Windows Server 2003.
  Unfortunately I can't use the built in poison message support targeted at MSMQ 4.0 and Vista/2008.</p>