Cannot read from a remote transactional private queue using WCF in workgroup mode (you can use System.Messaging!)

I spent days reading MSDN, forums and an article about it, and cannot find a solution to my problem.

As a PoC, I need to consume a queue from more than one machine, as I need fault tolerance on the consumer side. Performance is not a problem since less than 100 messages per day need to be exchanged.

I encoded two trivial console applications, one as a client and the other as a server. Using Framework 4.0 (also tested on 3.5). Messages use transactions.

Everything runs on the same machine (Windows 7), even when running multiple instances of the client application.

Now I have virtual test servers 2012 and 2008 R2 running in the same domain (but do not want to use AD integration anyway). I am using the IP address or ".". in the endpoint address attribute to prevent the side effects of DNS / AD resolution.

Everything works fine if the queue is placed by the consumer, and the producer sends messages to the remote private queue . This is also true if I exchange the consumer / producer roles of the 2012 and 2008 server.

But I NEVER was able to execute this run using WCF when the consumer reads from a remote queue and the producer sends messages locally . The package never stops, my problem is with the consumer.

My desire is to make this run using netMsmqBinding, but I also tried using msmqIntegrationBinding. For each test, I adapted the code and configuration, and then confirmed that this works fine when a consumer consumes from a local queue.

The last test I did was using WCF (msmqIntegrationBinding) for the manufacturer only (local queue) and System.Messaging.MessageQueue for the consumer (remote queue): it works great! => My goal is to do the same using WCF and netMsmqBinding on both sides.

In my point of view, I proved that this problem is a WCF problem, not MSMQ. This has nothing to do with security, authentication, firewall, transport, protocol, MSMQ version, etc.

Error Information Using the MS Service Trace Viewer:

Using msmqIntegrationBinding when receiving a message (the open queue was in order): An error occurred while receiving the message from the queue: the specified transaction could not be imported. (-1072824242, 0xc00e004e). Verify that MSMQ is installed and running. Make sure the queue is available for reception.

Using netMsmqBinding when opening a queue: An error occurred while converting the queue path name 172.22.1.9 \ private $ \ Test to format name: The specified path name is not valid. (-1072824300, 0xc00e0014). Failed to perform all operations on the queue in the queue. Verify that the queue address is valid. MSMQ must be installed with Active Directory integration enabled and accessible.

If someone can help find out why my configuration cannot be handled by WCF, a very elegant and custom way than Messaging, I would really appreciate it!

Thank you. 
+4
source share
1 answer

You may need to post your user code and configuration to give more ideas, but it could be a queue name construct - for example.

FORMATNAME: DIRECT = TCP: 192.168.0.2 \ SomeQueue

There are several ways to connect to a queue, and it changes when you are either deleted or local.

I found this article in the past to help:

http://blogs.msdn.com/b/johnbreakwell/archive/2009/02/26/difference-between-path-name-and-format-name-when-accessing-msmq-queues.aspx

Also, the MessageQueue Constructor on MSDN ... http://msdn.microsoft.com/en-us/library/ch1d814t.aspx

0
source

Source: https://habr.com/ru/post/1438910/


All Articles