发送到已验证的队列 [英] Sending to authenticated queue
问题描述
我的本地计算机上有一个事务专用队列.如果队列未通过身份验证,则消息进入队列.如果我将队列设置为通过身份验证,则不会.发送到队列的应用程序以我自己的身份运行(并且我对队列拥有完全控制权).匿名用户还对队列具有发送消息"权限.我对于将消息发送到经过身份验证的队列需要做什么感到困惑.
I have a transactional private queue on my local machine. If the queue is not authenticated, the message goes into the queue. If I set the queue to be authenticated, it doesn't. The application sending to the queue is running as myself (and I have full control on the queue). Anonymous users also have Send Message permissions on the queue. I'm confused as to what I need to do to send a message to an authenticated queue.
这是我正在使用的绑定:
Here is the binding that I am using:
NetMsmqBinding msmq = new NetMsmqBinding(NetMsmqSecurityMode.None);
msmq.MaxReceivedMessageSize = int.MaxValue;
msmq.CloseTimeout = TimeSpan.FromMinutes(3);
msmq.SendTimeout = TimeSpan.FromMinutes(3);
msmq.ReceiveTimeout = TimeSpan.FromMinutes(3);
msmq.ReaderQuotas.MaxDepth = int.MaxValue;
msmq.ReaderQuotas.MaxStringContentLength = int.MaxValue;
msmq.ReaderQuotas.MaxArrayLength = int.MaxValue;
msmq.ReaderQuotas.MaxBytesPerRead = int.MaxValue;
msmq.ReaderQuotas.MaxNameTableCharCount = int.MaxValue;
msmq.ExactlyOnce = true;
msmq.Durable = true;
msmq.TimeToLive = TimeSpan.FromHours(1);
理想情况下,我希望每个人(包括无法识别的用户)都能够发送消息,但限制谁可以窥视和接收消息.我不确定这是否可能.
Ideally, I would like to have everyone (including unrecognized users) be able to send messages, but limit who can peek and receive messages. I'm not sure if this is possible.
第一个问题:如何将消息发送到经过身份验证的队列中?
So, the first question: How can I get a message into an authenticated queue?
似乎我需要使用WindowsDomain
的msmqAuthenticationMode
开启传输安全性.但是,当我这样做时,会出现以下错误:
It looks like I need to turn transport security on with msmqAuthenticationMode
of WindowsDomain
. However, when I do, I get the following error:
Binding validation failed because the binding's MsmqAuthenticationMode property is set to WindowsDomain but MSMQ is installed with Active Directory integration disabled. The channel factory or service host cannot be opened.
好像我的MSMQ是以工作组模式而非目录模式安装的.我该如何解决?当我删除MSMQ并将其添加回(具有所有功能)时,它仍然不在目录模式下.我在Win7上.
Looks like my MSMQ is installed in Workgroup mode, not Directory mode. How do I fix that? When I remove MSMQ and then add it back (with all features), it's still not in Directory mode. I am on Win7.
推荐答案
MSMQ必须以目录模式安装,则必须将msmq.Security.Mode
设置为Transport
才能提供WindowsDomain凭据.要进入目录模式,您需要重新安装MSMQ-但请确保
MSMQ has to be installed in Directory mode, and you have to set msmq.Security.Mode
to Transport
to provide the WindowsDomain credentials. To get to Directory mode, you need to reinstall MSMQ - but make sure to remove the msmq object on your machine before reinstalling.
这篇关于发送到已验证的队列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!