加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

.net – 写入远程MSMQ

发布时间:2020-12-13 21:09:50 所属栏目:Windows 来源:网络整理
导读:好的,这是一个非常简单和根本的问题。 如果我在Windows机器A上有一个应用程序要在Windows机器B上写入队列,是否需要在机器A上安装MSMQ(即使在那里没有队列)?我刚刚开始为我的应用程序使用队列,并尝试了解一些基本原理。 谢谢 是的,您需要在本地安装MSMQ
好的,这是一个非常简单和根本的问题。
如果我在Windows机器A上有一个应用程序要在Windows机器B上写入队列,是否需要在机器A上安装MSMQ(即使在那里没有队列)?我刚刚开始为我的应用程序使用队列,并尝试了解一些基本原理。

谢谢

是的,您需要在本地安装MSMQ才能写入远程队列。如果您正在写私人队列,请查看 this page,其中有关如何格式化队列名称的有用信息。如果你正在写一个远程的事务队列,那么你需要确保你正确地指定(点5)

这是文章文字:

1. When working with remote queues,the queue name in the format machinenameprivate$queuename doesn’t work. This results in an
“invalid queue path” error.

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

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.

For Eg.

06000

3. Further to previous point,note that FormatName is case sensitive. If you mention the earlier string as
FORMATNAME:Direct=OS:machinenameprivate$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. In case you want to use the machine’s IP address the syntax will be FormatName:Direct=TCP:ipaddressprivate$queuename.

For Eg.

06001

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

06002

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. 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).

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读