I have a transactional MSMQ queue setup on server THOR. I am able to post messages to that queue from a workstation with the following code:
var queue = new MessageQueue("FormatName:Direct=OS:thor\\private\\myqueue");
using (var tx = new MessageQueueTransaction())
{
tx.Begin();
queue.Send("test", tx);
tx.Commit();
}
However, when I attempt to connect using WCF my messages never appear in the queue. Here is the configuration I'm using:
<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>
And the code:
using (var tx = new TransactionScope())
{
var cf = new ChannelFactory<INewsFeedService>("INewsFeedService");
var service = cf.CreateChannel();
service.TestMessage("test");
((IChannel)service).Close();
tx.Complete();
}
I get no exceptions of any kind, but there is no message posted on the queue on THOR. Any ideas? I don't even know how to debug this since it just silently fails.
UPDATE
If I change my MSMQ URI to 'net.msmq://localhost/private/myqueue' then it will post to a local transactional queue I have setup. The setup of the queue itself is identical (as in, I performed the same steps to create both the localhost and THOR queues).