我有一个目前抛出的程序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