具有无效路径的私有 MessageQueue 对象会触发 MessageQueueException 吗?
首先,我没有使用 MSMQ 的经验。
假设将无效路径传递到私有 MessageQueue 对象的构造函数中,那么在调用 send 方法时会触发 MessageQueueException 吗?如果是这样,错误代码仍然是 QueueNotFound 吗? MSDN 指出,对于未在目录中注册的公共队列以及消息队列命名空间中不存在的 Internet 队列,会返回此错误。但是,根据我读到的内容,专用队列未在 Active Directory 中发布,因此我不确定会发生什么。
如果这没有意义,我深表歉意。
First off, I have no experience with MSMQ.
Supposing an invalid path is passed into the constructor for a private MessageQueue object, would it trigger a MessageQueueException when the send method is called? If so, would the error code still be QueueNotFound? MSDN states that this error is returned for public queues not registered in the directory and Internet queues that do not exist in the Message Queueing namespace. However, according to what I read, a private queue is not published in the Active Directory, so I'm not sure what would happen.
I apologize if this makes no sense.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您尝试发送到不存在的队列,那么只要队列名称的格式有效,发送调用就不会失败。我的意思是,目标队列地址不需要存在,但队列名称的格式必须正确。
相反,MSMQ 子系统会将消息本地排队到临时出站队列中,您应该能够看到该队列出现在框中。
它这样做的原因是它认为目标队列可能暂时不可用,当它再次可用时,消息将被传输。
然而,在一段时间后(不记得默认值),它会将消息移动到死信队列中,因为无法传递。
希望这有帮助。
If you try to send to a queue which does not exist then the call to send will not fail as long as the queue name is in a valid format. What I mean by this is that the destination queue address does not need to exist, but the format of the queue name must be correct.
Rather, the MSMQ subsystem will queue the message locally in a temporary outbound queue, which you should be able to see appear on the box.
The reason it does this is because it thinks that the destination queue may be temporarily unavailable and when it becomes available again the message will be transmitted.
However after a period of time (can't remember default) it will move the message into the dead letter queue as undeliverable.
Hope this helps.