简体   繁体   English

企业库msmq侦听器和专用远程队列-无法发送消息

[英]Enterprise library msmq listener and private remote queues - cannot send message

I have the following problem: 我有以下问题:

I am trying to log messages to the remote private message queue. 我正在尝试将消息记录到远程私人消息队列中。 To do this I am using Enterprise library 5.0 and msmq trace listener in my application. 为此,我在应用程序中使用了Enterprise Library 5.0和msmq跟踪侦听器。 Unfortunately, I always end up with the following error: 不幸的是,我总是会遇到以下错误:

Exception Type: System.Messaging.MessageQueueException MessageQueueErrorCode: IllegalFormatName Message: Format name is invalid. 异常类型:System.Messaging.MessageQueueException MessageQueueErrorCode:IllegalFormatName消息:格式名称无效。 ErrorCode: -2147467259 错误代码:-2147467259

This is the queue path I am using: 这是我正在使用的队列路径:

FormatName:Direct=TCP:192.168.1.1\\Private$\\MyPrivateQueue FormatName:Direct = TCP:192.168.1.1 \\ Private $ \\ MyPrivateQueue

  1. When I create MSMQ message directly (not using EntLib) and use above mentioned queue path, everything works fine. 当我直接创建MSMQ消息(不使用EntLib)并使用上述队列路径时,一切正常。
  2. Also, when I change queue path to local private queue and use EntLib, message is also sent correctly and this is why I am confused. 另外,当我将队列路径更改为本地专用队列并使用EntLib时,消息也会正确发送,这就是我感到困惑的原因。

As I understand, 1) shows that remote message queue is accessible and queue path is correct and 2) shows that EntLib Logging application block settings are correct. 据我了解,1)显示远程消息队列可访问且队列路径正确,而2)显示EntLib Logging应用程序块设置正确。

If anyone has any idea what could be the problem or you need clarification on anything please feel free to comment. 如果有人知道可能是什么问题,或者您需要澄清任何问题,请随时发表评论。

I found my problem. 我发现了问题。 It appears I was not so careful and wrote this in the config file: 看来我不是很小心,并将其写在配置文件中:

FormatName:Direct=TCP:192.168.1.1\\\\Private$\\\\MyPrivateQueue FormatName:Direct = TCP:192.168.1.1 \\\\ Private $ \\\\ MyPrivateQueue

and it should be like this: 它应该是这样的:

FormatName:Direct=TCP:192.168.1.1\\Private$\\MyPrivateQueue FormatName:Direct = TCP:192.168.1.1 \\ Private $ \\ MyPrivateQueue

So, if anyone had a similar problem, here is the solution 所以,如果有人遇到类似的问题,这就是解决方案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM