简体   繁体   English

添加自定义MSMQ属性

[英]Adding custom MSMQ properties

I am designing an application that creates, uses and deletes MSMQ message queues. 我正在设计一个创建,使用和删除MSMQ消息队列的应用程序。 Each queue has custom properties which I am currently storing in a file. 每个队列都有我当前存储在文件中的自定义属性。

I find this messy however and the whole system could go down if this file were to dissappear. 我发现这很混乱,但是如果此文件消失了,整个系统可能会崩溃。

Is there a way I can bind custom properties (eg a property xml string) to the actual message queues which I am using? 有什么方法可以将自定义属性(例如,属性xml字符串)绑定到我正在使用的实际消息队列中?

Cheers, Shane 干杯,谢恩

While I don't know if that is possible you many not want your configuration to go down with the queue either. 虽然我不知道这是否可行,但许多人也不希望您的配置随队列而变。 I would suggest some other kind of external storage mechanism. 我会建议其他种类的外部存储机制。 You could use another queue that holds messages for each queue configuration(just make sure it's a durable one). 您可以使用另一个队列来保存每个队列配置的消息(只需确保它是持久的即可)。 You could also look into using a database to hold your configuration and make sure that is backed up. 您还可以考虑使用数据库来保存您的配置,并确保已对其进行备份。

The queues are either defined in Active Directory or as text files (in the system32\\msmq\\storage\\LQS folder), for public and private respectively. 分别在Active Directory中定义队列或将其定义为文本文件(在system32 \\ msmq \\ storage \\ LQS文件夹中),分别用于公用和专用。

In theory you may be able to add custom properties to the public queue object in AD. 从理论上讲,您可以将自定义属性添加到AD中的公共队列对象。 Similarly, you may be able to add text to the private queue text file (although it may get stripped out should the queue properties be changed). 同样,您可以将文本添加到专用队列文本文件中(尽管如果更改队列属性,它可能会被剥离)。

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

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