.net MSMQ 消息卡在传出队列中
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4044365/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
MSMQ Messages Are Stuck In The Outgoing Queue
提问by mark
Although my question looks similar to some already found on SO, those post did not help me, so here it is:
虽然我的问题看起来与 SO 上已经找到的一些问题相似,但那些帖子对我没有帮助,所以这里是:
Given:
鉴于:
- Two machines on the same segment (naturally in the same domain, actually on the same desk)
- Both machines are Windows 7 workstations
- Both machines have disabled firewall
- Both machines see each other (ping works)
- There is a private non transactional message queue teston one of them.
- The sender machine has
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSMQ\SimpleClient\@BinaryEnabled = 'Yes' - The queue owner sends a message from another machine
- The message is stuck on the outgoing queue, never reaching the target.
- When sent from the same machine (i.e. locally) the message arrives OK.
- 同一个网段的两台机器(自然在同一个域,实际上在同一张桌子上)
- 两台机器都是Windows 7工作站
- 两台机器都禁用了防火墙
- 两台机器互相看到(ping 工作)
- 其中之一有一个私有的非事务性消息队列测试。
- 发件人机器有
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSMQ\SimpleClient\@BinaryEnabled = 'Yes' - 队列所有者从另一台机器发送消息
- 消息停留在传出队列中,永远不会到达目标。
- 当从同一台机器(即本地)发送时,消息到达 OK。
The message is sent using the following code:
使用以下代码发送消息:
var q = new MessageQueue(@"FormatName:Direct=OS:il-mark-lap\private$\test");
q.Send(string.Format("Test message sent at {0} from {1}", DateTime.Now, Environment.MachineName));
Where il-mark-lapis the address of the machine with the queue.
其中il-mark-lap是带有队列的机器的地址。
What on earth do I have to do to make the thing work?
我到底需要做什么才能让这件事发挥作用?
Thanks a lot.
非常感谢。
回答by BlackICE
I think I found the answer to this issue, I was having what appears to be the same problem, mine only got stuck after not sending messages to the client for 10 minutes though. Take a look at this KB article, it may help you. Also, in my case it had nothing to do with restarting, so don't let that throw you off, I did exhibit the symptoms in the netstat and messages would initially go through when the client was first started up.
我想我找到了这个问题的答案,我遇到了似乎同样的问题,我的只是在 10 分钟没有向客户端发送消息后卡住了。看看这篇知识库文章,它可能对你有帮助。此外,在我的情况下,它与重新启动无关,所以不要让这让您失望,我确实在 netstat 中表现出症状,并且消息最初会在客户端首次启动时通过。
回答by Karell Ste-Marie
I just dealt with the problem, here are the steps that I took in order to resolve it:
我刚刚处理了这个问题,以下是我为解决它而采取的步骤:
Get the DTCPingutility from Microsoft, run it on the machines that use MSMQ, the DTCs must be able to talk to one-another in order for MSMQ to work.
从 Microsoft获取DTCPing实用程序,在使用 MSMQ 的机器上运行它,DTC 必须能够相互通信才能使 MSMQ 工作。
Troubleshooting MSDTC issues with the DTCPing tool
This in turn made me realize that MSMQ is highly dependant on NetBIOS names - the machines must be able to ping each other by using NetBIOS names alone.
这反过来让我意识到 MSMQ 高度依赖于 NetBIOS 名称 - 机器必须能够单独使用 NetBIOS 名称相互 ping 通。
Once this is done, make sure that you restart ALL Message Queueing services (both on sending machine and on destination machine as it needs to be able to perform a reverse NetBIOS operation).
完成此操作后,请确保重新启动所有消息队列服务(在发送机器和目标机器上,因为它需要能够执行反向 NetBIOS 操作)。
In my case, once I got the DTC going with NetBIOS name resolution - restarted the services - everything started working magically.
就我而言,一旦我通过 NetBIOS 名称解析获得 DTC - 重新启动服务 - 一切都开始神奇地工作。
I highly recommend that you visit this pagefor additional resources.
我强烈建议您访问此页面以获取更多资源。
回答by GrokSrc
I had this problem today. To resolve it we had to open the Message Queuing properties dialog of the receiving server and on the Server Security tab uncheck the box for "Disable un-authenticated RPC calls". Also, on the private queue Properties | Security tab we changed the security to grant Everyone Full Control. In my case the machines are on the same segment, but not on the same domain. The queue is non-transactional. We are using IP Addresses for the endpoint bindings (WCF), NetBIOS/DNS is not in play.
我今天遇到了这个问题。要解决它,我们必须打开接收服务器的消息队列属性对话框,并在服务器安全选项卡上取消选中“禁用未经身份验证的 RPC 调用”框。此外,在私有队列 Properties | 安全选项卡我们更改了安全性以授予每个人完全控制权。在我的情况下,机器位于同一网段,但不在同一域中。队列是非事务性的。我们正在使用 IP 地址进行端点绑定 (WCF),NetBIOS/DNS 没有发挥作用。
回答by David Fidge
I had an issue where we had 2 servers sending messages to a third. Only one server's messages were being received. The messages from the other one were stuck in the outgoing queue as 'unacknowledged'.
我有一个问题,我们有 2 个服务器向第三个服务器发送消息。只接收到一台服务器的消息。来自另一个的消息被卡在传出队列中为“未确认”。
The problem was because all computers were cloned VM's and had the same QMId in the registry key: HKLM\Software\Microsoft\MSMQ\Parameters\Machine Cache. We reinstalled MSMQ on the servers which fixed the problem.
问题是因为所有计算机都是克隆的 VM,并且在注册表项中具有相同的 QMId:HKLM\Software\Microsoft\MSMQ\Parameters\Machine Cache。我们在解决问题的服务器上重新安装了 MSMQ。
References:
参考:
http://baleinoid.com/whaly/2012/08/random-bug-msmq-unacknowledged-messages/http://blogs.msdn.com/b/johnbreakwell/archive/2007/02/06/msmq-prefers-to-be-unique.aspx
http://baleinoid.com/whaly/2012/08/random-bug-msmq-unacknowledged-messages/ http://blogs.msdn.com/b/johnbreakwell/archive/2007/02/06/msmq-prefers-成为唯一的.aspx
回答by mugume david
The answer is quit easy. Ensure you can telnet ports 1801,135,2103 & 2105 from both the source machine to the destination and vice versa. Also make sure MSMQ is running on both machines.
答案很简单。确保您可以从源计算机到目标计算机 telnet 端口 1801、135、2103 和 2105,反之亦然。还要确保 MSMQ 在两台机器上都运行。
回答by log111
Normally private queues in a LAN can sends messages to each other. But sometimes a private queue may be unreachable and causes others to create outgoing queues... Don't know why.
通常 LAN 中的专用队列可以相互发送消息。但有时私有队列可能无法访问并导致其他人创建传出队列......不知道为什么。

