0

I have a wcf service that I am hosting within a windows service on a windows 2003 server that is listening on a MSMQ queue. I set the ReceiveRetryCount = 2 on the netmsmqbinding. The service was setup to use transactions ([OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete= true)]). The service was functioning great.

I needed to turnoff the transactions due to a database call that couldn't support MSDTC. So I switched the service properties to

[OperationBehavior(TransactionScopeRequired = false)]

Now, when an exception or fault is thrown, no retry occurs, the fault handler for the service never fires. The original message ends up in the system DLQ. I would like the fault handler to handle the faults after two retries. Any ideas?

trouta
  • 426
  • 3
  • 12

1 Answers1

2

Switch things back to the way they were before.

Around the database call, add the following (code is done from memory- let me know if I need to fix this up a bit):

// using System.Transactions;

using( var ts = new TransactionScope( TransactionScopeOption.Suppress ) )
{
  // Call DB stuff
  ts.Complete();
}
Tim M.
  • 53,671
  • 14
  • 120
  • 163
Scott Seely
  • 757
  • 4
  • 6