MSMQ - 无法从组播接收队列 [英] MSMQ - Cannot receive from Multicast queues

查看:297
本文介绍了MSMQ - 无法从组播接收队列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让我围绕如何在多播MSMQ作品,但我根本无法接收邮件头,即使从同一台机器。 。我明明做错了什么,但什么也看不见。

I am trying to get my head around how multicasting works in MSMQ but I cannot receive messages at all, even from the same machine. I'm obviously doing something wrong but cannot see what.

下面是我在哪里:

我手动创建名为 MulticastTest时非事务性私有队列,然后设置多播地址 234.1.1.1:8001 。然后我的测试应用程序发送执行此:

I manually created a non-transactional private queue called MulticastTest and then set the Multicast address to 234.1.1.1:8001. Then my test sending app does this:

MessageQueue queue = new MessageQueue("FormatName:MULTICAST=234.1.1.1:8001");
queue.Send("Hello World");

这工作,但它至少看起来送我在传出队列看到同样的消息机。至少我认为这是正确的,请告诉我,如果事实并非如此。

This works, it at least seems to send the message which I see in an outgoing queue on the same machine. At least I assume this is correct, please tell me if it isn't.

所以现在我尝试运行我的接收应用程序(无论是在同一台机器或不同的一个配置的同一个组播地址),我无法得到它的工作。如果我试试这个:

So now I try and run my receiving app (either on the same machine or a different one configured to the same multicast address) and I cannot get it to work. If I try this:

MessageQueue queue = new MessageQueue("FormatName:MULTICAST=234.1.1.1:8001");
var message = queue.Receive();



这是行不通的,在接收()方法抛出异常的说法:

It simply won't work, the Receive() method throws an exception saying:

指定的格式名称不支持请求的操作。
为例,直接的队列格式名不能被删除

The specified format name does not support the requested operation. For example, a direct queue format name cannot be deleted

如果我尝试并设置接收队列为 .\private $ \MulticastTest 它至少等待消息,但没有任何反应,所有的消息还停留在传出队列。

If I try and set the receiving queue as .\private$\MulticastTest it at least waits for a message but nothing happens, all messages still stay in the outgoing queue.

那么,我做错了什么?是否某种服务需要运行的MSMQ从传出队列发送邮件?

So what am I doing wrong? Does some kind of service need to be running for MSMQ to send out messages from the outgoing queue?

我也试图充分权限匿名用户按<一个HREF =htt​​p://stackoverflow.com/questions/8588377/using-multicast-queues-in-system-messaging-and-msmq-3-0>这个问题但是这并没有影响。

I have also tried giving full permissions to the ANONYMOUS USER as per this question but that has no affect.

推荐答案

多次实验后,我终于想通了,我需要得到组播队列工作的正确步骤。

After much experimentation I finally figured out the correct steps I needed to get multicast queues to work.

首先,确保你已经安装了的MSMQ组播功能!尽管能够创建一个队列在我的服务器的一个组播地址,服务器管理器居然告诉我该组件没有安装。

First and foremost, make sure you've got the MSMQ Multicast feature installed! Despite being able to create a queue with a multicast address on one of my servers, Server Manager actually told me that the component wasn't installed.

出来试图在此之后我的本地机器,而不是我在事件日志中发现了这条消息:

After trying this out on my local machine instead I found this message in my event log:

消息队列发现多个IP地址为本地计算机。
消息队列将使用多播消息PGM
驱动决定的默认IP地址。要使用不同的IP地址,
\HKLM\Software\Microsoft\MSMQ\Parameters\MulticastBindIP注册表
值设置为以下有效IP地址之一:上市[IP地址这里]

Message Queuing found multiple IP addresses for the local computer. Message Queuing will use the default IP address determined by the PGM driver for multicast messages. To use a different IP address, set the \HKLM\Software\Microsoft\MSMQ\Parameters\MulticastBindIP registry value to one of the following valid IP addresses: [IP addresses listed here]

原来我有我的本地区域网络中的多个IP地址,所以首先我添加使用正确的IP此注册表项地址需要发送消息,然后重新启动消息队列服务。更多详细信息可以在这里找到: http://technet.microsoft.com/en-美国/库/ cc756156(WS.10)的.aspx

It turns out I had multiple IP address for my local area network, so first I added this registry key using the correct IP address needed to send out messages and then restart the Message Queueing service. More details can be found here: http://technet.microsoft.com/en-us/library/cc756156(WS.10).aspx

接下来我不得不添加的权限为匿名登录用户我的消息队列,所以我给了(至少)接收和发送的权限。

Next I had to add permissions to my message queue for the ANONYMOUS LOGON user, so I gave (at a minimum) Receive and Send permissions.

现在送东西。你需要的队列名称的正确格式如下:

Now to send something. The correct format of the queue name you need is as follows:

FormatName:MULTICAST=234.1.1.1:8001

或你选择的多播IP地址/端口。我发送应用程序现在发出的消息,我可以看到它现在出现在我的绑定在这个多播地址专用队列。这意味着,消息肯定被发送。

or whatever your multicast IP address/port is. My sending app now sent out the message and I could see that it now appears in my private queue which is tied to this multicast address. This means that the message has definitely been sent.

在接收端,我要听的专用队列(不高于组播格式),所以我听的

On the receiving end, I need to listen to the private queue (not the multicast format above), so I listen on:

.\private$\MulticastTest

最后,我看到我送出现在接收端的消息。

Finally I see the message I sent appear on the receiving end.

作为一个健全检查我的设置另一个队列指向同一个组播地址(确保机器上我遵循相同的步骤以上)和现在可以从一台机器发送一条消息,并经多台机器接收。

As a sanity check I setup another queue pointing to the same multicast address (making sure on that machine I followed the same steps above) and can now send a message from one machine and have it received by multiple machines.

我希望这个答案是帮助他人,因为这是对我来说是真正的审判和错误的努力。

I hope this answer is of help to others as it was a real trial-and-error effort for me.

这篇关于MSMQ - 无法从组播接收队列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆