写入远程MSMQ [英] Writing to a remote MSMQ

查看:194
本文介绍了写入远程MSMQ的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好了,这是一个非常简单和基本的问题。 如果我有想要写在Windows机器B队列的Windows计算机A中的应用程序,是否需要安装机器A MSMQ(即使没有队列存在)?我刚开始使用队列,我的应用程序,并试图找出一些基础知识了。

Okay, here is a very simple and fundamental question. If I have an application on windows machine A that wants to write to a queue on windows machine B, do I need to have MSMQ installed on machine A (even though there is no queue there)? I am just beginning to use queues for my applications and trying to figure some fundamentals out.

感谢

推荐答案

是的,你需要安装在本地MSMQ写入远程队列。如果你正在写一个专用队列,看看此页面其中有有用的信息如何格式化队列名称。如果你正在写一个远程事务队列,那么你需要确保你指定的正确(5点)

Yes, you need MSMQ installed locally to write to a remote queue. If you're writing to a private queue, take a look at this page which has useful information on how to format the queue name. If you're writing to a remote Transactional queue, then you need to make sure you specify that correctly (point 5)

这是文章全文:

1。当远程队列工作,格式为计算机名\私人$ \ queuename的队列名称不起作用。这导致   无效的队列路径错误。

1. When working with remote queues, the queue name in the format machinename\private$\queuename doesn't work. This results in an "invalid queue path" error.

2。队列名称必须提到的 FORMATNAME:直接= OS:计算机名\\私人$ \\ queuename

2. The queue name has to be mentioned as FormatName:Direct=OS:machinename\\private$\\queuename.

这是必要的,因为队列访问内部进行使用格式   只有名称语法。其他友好再presentation转换为   所述FORMATNAME,然后使用。当远程队列,除非工作   有一个AD解决队列名称,好记的名称不会   工作。查看文档的详细信息。

This is necessary since the queue access is internally done using the format name syntax only. The other friendly representation is converted to the FormatName and then used. When working with remote queues, unless there is an AD to resolve the queue name, the friendly name won't work. Check out documentation for details.

有关例如:

MessageQueue rmQ = new MessageQueue 
              ("FormatName:Direct=OS:machinename\\private$\\queue");
rmQ.Send("sent to regular queue - Atul");

     

3。继previous点,注意FORMATNAME是区分大小写的。如果你提到早前字符串    FORMATNAME:直接= OS:计算机名\\私人$ \\ queuename ,也不会   工作。出人意料的是,没有错误抛出在这种情况下。   FORMATNAME字符串的一部分似乎是唯一的区分大小写   部分。其他人可以出现在不同的情况下。对于如。你可以写   直接。

3. Further to previous point, note that FormatName is case sensitive. If you mention the earlier string as FORMATNAME:Direct=OS:machinename\\private$\\queuename, it won't work. Surprisingly, there is no error thrown in this case. "FormatName" part of the string seems to be the only case sensitive part. Others can appear in different case. For eg. You can write "DIRECT".

4。如果你要使用的机器的IP地址的语法为 FORMATNAME:直接= TCP:\\ ip地址专用$ \\ queuename

4. In case you want to use the machine's IP address the syntax will be FormatName:Direct=TCP:ipaddress\\private$\\queuename.

有关例如:

MessageQueue rmQ = new MessageQueue
              ("FormatName:Direct=TCP:121.0.0.1\\private$\\queue");
rmQ.Send("sent to regular queue - Atul");

     

5。队列实例的创建在code的事务属性应该与你正在尝试发送队列匹配   消息。因此,前面的例子中,我会发送消息到   非事务队列。要发送到事务性队列时,code   将

5. The transactional properties of the queue instance you create in code should match with that of the queue you are trying to send the message to. So in the earlier examples, I was sending message to a non-transactional queue. To send to a transactional queue, the code would be

MessageQueue rmTxnQ = new MessageQueue
            ("FormatName:Direct=OS:machinename\\private$\\queue");
rmTxnQ.Send("sent to Txn queue - Atul", MessageQueueTransactionType.Single);

如果事务属性不匹配,也不会是消息   交付使用。令人惊讶的部分又是,我没有得到任何错误,并   该消息就消失了。

If the transactional properties don't match, the message will not be delivered. The surprising part is again, I didn't get any error, and the message just disappeared

6。最后,当你将消息发送到远程队列,临时传出队列是在自己的机器上创建的。这是用来在壳体   远程队列不可用。如果你去到计算机管理   控制台(COMPMGMT.MSC),并展开服务和应用程序/   消息队列/传出队列,你会看到这些队列。该   右侧控制台应显示信息的状态   (连接与否)和IP地址(ES)为下一跳(S)。

6. Finally, when you send messages to remote queue, a temporary outgoing queue is created on your own machine. This is used in case the remote queue is unavailable. If you go to the computer Management console (compmgmt.msc), and expand the Services and Applications / Message Queuing / Outgoing Queues, you would see these queues. The right side of the console should show the details including the state (connected or not) and the IP address(es) for the next hop(s).

这篇关于写入远程MSMQ的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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