title: NetMsmqBinding: messages are being processed multiple times
body: <p>My team has a windows service which host a wcf service using http binding. When the wcf service receives a message, it immediately sends it to another wcf service, using NetMsmqBinding, also hosted in a windows service. The msmq service process the message and save it do our DB.  </p>
  
  <p>In the development and staging environments, everything worked fine. When we deployed to production though, we saw that messages sent to our service are being multiplied by a factor of n+1 (for n messages).  </p>
  
  <p>For example: 1 message received, 2 saved to DB. 4 messages received, 20 saved to DB etc.  </p>
  
  <p>We suspect that it has something to do with the msmq service settings of Transactions, </p>
  
  <p>Concurrency, and InstanceContextMode, but we can't figure it out.  </p>
  
  <p>The settings of the service are:</p>
  
  <ul>
  <li>InstanceContextMode: Default.  </li>
  <li>ConcurrenyMode: Default  </li>
  <li>Transaction: TransactionScoreRequired = True and TransactionAutoComplete = True.</li>
  <li>RetryCount = 1, RetryCycles = 1</li>
  </ul>
  
  <p>We use .Net 4, MSMQ 3.0 and Windows server 2003.</p>
  
  <p>Any ideas to what might cause this issue?</p>
  
  <p>Edit:</p>
  
  <p>After a lot of research, we have discovered the following things:</p>
  
  <ul>
  <li>When the wcf runtime tries to commit the transaction for a single message, it throws an exception of "Transaction was aborted asynchronously". This exception is thrown each time a message is duplicated.</li>
  <li>In the wcf trace, we don't see any exception other then the one stated above.</li>
  <li>In the System.Transaction trace, we see a transaction is being opened (for the 1st message), and then after the wcf runtime creates a clone of that transaction (with the property RollbackIfNotCompleted=true), a few seconds pass without no message in the trace and then the same thing happens again.</li>
  </ul>
  
  <p>We really are clueless...</p>
  
  <p>Thanks</p>