我有一個目前拋出的程序MSMQ事務還沒有開始。如果此事務用於發送而沒有任何警告或異常,MSQM將把消息放入死信隊列中!異常。我不確定我做了什麼錯誤,所以無論如何調試/記錄消息隊列事務的當前狀態?反正有調試/日誌消息隊列事務嗎?
基本上,我目前有:
DoSomething(); // may have problem here
using (var scope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = IsolationLevel.ReadCommitted, Timeout = TransactionManager.DefaultTimeout }))
{
// throws exception here, but I believe the above method does something wrong
bus.Publish(new SomethingHappened(1, "test"));
scope.Complete();
}
好的。我可以使用TransactionContext.Current獲取當前事務上下文。 MessageQueueTransactionStatus已提交。所以我不知道爲什麼它不被清理? – Yin 2014-09-02 04:15:08
你能顯示你的總線配置嗎? – user1121956 2014-09-02 11:58:43
和DoSomething()做什麼,如果你說它可能會導致問題,你有沒有試圖避免它? – user1121956 2014-09-02 11:59:53