Hello,
How would I handle poison messages when not using WCF? The code below creates a loop, and I was curious if MSMQ provided a system to automatically handle poison messages.
MessageQueue mq = new MessageQueue(@".\Private$\My/Queue");
while (true)
{
using (MessageQueueTransaction _transaction =
new MessageQueueTransaction())
{
_transaction.Begin();
try
{
Message msg = mq.Receive(_transaction);
//HandleMessage(msg);
throw new Exception("Kaboom!");
_transaction.Commit();
}
catch (Exception ex)
{
_transaction.Abort();
}
}
}
Thanks! James