4
votes

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

As a PoC, I need to consume a queue from more than one machine since I need fault tolerance on the consumers side. Performance is not an issue since less than 100 messages a day should by exchanged.

I have coded two trivial console application , one as client, the other one as server. Using Framework 4.0 (tested also on 3.5). Messages are using transactions.

Everything runs fines on a single machine (Windows 7), even when running multiple consumers application instance.

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

Everything works fine IF the the queue is hosted by the consumer and the producer is submitting messages on the remote private queue. This is also true if I exchange the consumer / producer role of the 2012 and 2008 server.

But I have NEVER been able to make this run, using WCF, when the consumer is reading from remote queue and the producer is submitting messages localy. Submition never fails, my problem is on the consumer side.

My wish is to make this run using netMsmqBinding, but I also tried using msmqIntegrationBinding. For each test, I adapted code and configuration, then confirmed this was running ok when the consumer was consuming from the local queue.

The last test I have done is using WCF (msmqIntegrationBinding) only on the producer (local queue) and System.Messaging.MessageQueue on the consumer (remote queue) : It works fine ! => My goal is to make the same using WCF and netMsmqBinding on both sides.

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

Errors info using MS Service Trace Viewer :

Using msmqIntegrationBinding when receiving the message (openning queue was ok) : An error occurred while receiving a message from the queue: The transaction specified cannot be imported. (-1072824242, 0xc00e004e). Ensure that MSMQ is installed and running. Make sure the queue is available to receive from.

Using netMsmqBinding, on opening the queue : An error occurred when converting the '172.22.1.9\private$\Test' queue path name to the format name: The queue path name specified is invalid. (-1072824300, 0xc00e0014). All operations on the queued channel failed. Ensure that the queue address is valid. MSMQ must be installed with Active Directory integration enabled and access to it is available.

If someone can help to find why my configuration cannot be handled by WCF, a much elegant and configurable way than Messaging, I would greatly appreciate !

 Thank you.
1
I know this doesn't asnwer your question, but do you really need to do a remote transactional read? This should only be done when there is no other option.tom redfern
Hugh, as I write in my message, I expect a fault tolerent consumer. It means having more than on instance of consumer running on differant computers reading from the same queue. Considering this, this not possible to host the queue on the consumer side. If you have any suggest to handle this problem another way, feel free to suggest. Thanks.Fredy06
It would be better to have your sender send a message to each of the consumers. This would mean that each of your consumers could read from a local queue. Send remote, read local.tom redfern
Yes, except if your message must be handled exactly once. This is also why I am using transactions. Consumers are independant and don't know each others. This is a common situation in message processing.Fredy06
The dispatcher pattern: eaipatterns.com/MessageDispatcher.html. This would appear to support what you need and allows you to avoid remote reads.tom redfern

1 Answers

0
votes

You may need to post you consumer code and config to give more of an idea but it could be the construction of the queue name - e.g.

FormatName:DIRECT=TCP:192.168.0.2\SomeQueue

There are several different ways to connect to a queue and it changes when you are remote or local as well.

I have 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, MessageQueue Constructor on MSDN... http://msdn.microsoft.com/en-us/library/ch1d814t.aspx