4
如何在不使用WCF時處理中毒消息?下面的代碼創建一個循環,我很好奇,如果MSMQ提供了一個系統來自動處理有毒信息。MSMQ中毒消息處理
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();
}
}
}
右所以我要實現自己的計劃。 – James 2009-04-13 17:55:00