我有服務器THOR上的事務性MSMQ隊列設置。我能夠從工作站郵件投遞到該隊列用下面的代碼:爲什麼我排隊的WCF消息悄然消失?
var queue = new MessageQueue("FormatName:Direct=OS:thor\\private\\myqueue");
using (var tx = new MessageQueueTransaction())
{
tx.Begin();
queue.Send("test", tx);
tx.Commit();
}
然而,當我嘗試使用WCF我的郵件永遠不會出現在隊列中進行連接。下面是我使用的配置:
<system.serviceModel>
<bindings>
<netMsmqBinding>
<binding name="ClientNewsFeedServiceBinding" durable="true" exactlyOnce="true">
<security mode="None" />
</binding>
</netMsmqBinding>
</bindings>
<client>
<!-- NewsFeed Service -->
<endpoint name="INewsFeedService"
address="net.msmq://thor/private/myqueue"
binding="netMsmqBinding"
bindingConfiguration="ClientNewsFeedServiceBinding"
contract="Service.Contract.INewsFeedService" />
</client>
</system.serviceModel>
,代碼:
using (var tx = new TransactionScope())
{
var cf = new ChannelFactory<INewsFeedService>("INewsFeedService");
var service = cf.CreateChannel();
service.TestMessage("test");
((IChannel)service).Close();
tx.Complete();
}
我得不到任何形式的例外情況,但沒有公佈於THOR隊列消息。有任何想法嗎?我甚至不知道如何調試,因爲它只是默默地失敗。
UPDATE
如果我改變我的MSMQ URI爲 'net.msmq://本地主機/私營/ myQueue中',那麼它會發布到本地事務性隊列我有安裝。隊列本身的設置是相同的(因爲我執行相同的步驟來創建localhost和THOR隊列)。
這些消息是否顯示在您的事務性死信隊列中? – 2010-10-05 15:59:31
不,沒有出現在交易DLQ – AgileJon 2010-10-05 16:00:30
更新我的答案 - 你檢查了所有涉及的機器上的DTC? – 2010-10-05 20:54:50