Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wcf msmq身份验证会减慢加密速度_Wcf_Msmq_Msmqintegrationbinding - Fatal编程技术网

Wcf msmq身份验证会减慢加密速度

Wcf msmq身份验证会减慢加密速度,wcf,msmq,msmqintegrationbinding,Wcf,Msmq,Msmqintegrationbinding,当发送加密的msmq消息时,身份验证似乎会将速度从2500 msg/s降低到150 msg/s q1.Send(new Message { BodyStream = new MemoryStream( Encoding.ASCII.GetBytes("ABCDEFGHIJKLMNOPQRSTUVXYZ")), Label = i.ToString(), //UseAuthentication = true, UseEncr

当发送加密的msmq消息时,身份验证似乎会将速度从2500 msg/s降低到150 msg/s

q1.Send(new Message 
{
    BodyStream = new MemoryStream(
        Encoding.ASCII.GetBytes("ABCDEFGHIJKLMNOPQRSTUVXYZ")),
        Label = i.ToString(),
        //UseAuthentication = true,
        UseEncryption = true
}, msmqTx);
System.Messaging.MessageQueue和具有msmqIntegration绑定的Wcf客户端似乎都是这样

q1.Send(new Message 
{
    BodyStream = new MemoryStream(
        Encoding.ASCII.GetBytes("ABCDEFGHIJKLMNOPQRSTUVXYZ")),
        Label = i.ToString(),
        //UseAuthentication = true,
        UseEncryption = true
}, msmqTx);
我的要求是加密传输,我可以不进行身份验证。我更喜欢WCF客户端,因为可以从app.config更改设置

q1.Send(new Message 
{
    BodyStream = new MemoryStream(
        Encoding.ASCII.GetBytes("ABCDEFGHIJKLMNOPQRSTUVXYZ")),
        Label = i.ToString(),
        //UseAuthentication = true,
        UseEncryption = true
}, msmqTx);
msmqIntegrationBinding有没有一种方法可以在不进行身份验证的情况下进行传输加密

    <msmqIntegrationBinding>
        <binding name="VisionAirMessagingBinding"
            timeToLive="12:00:00"
            maxReceivedMessageSize="4100000"
            receiveErrorHandling="Move"
            retryCycleDelay="00:30:00"
            useMsmqTracing="false"
            serializationFormat="Stream">
            <security mode="Transport">
                <transport msmqAuthenticationMode="WindowsDomain"
                    msmqEncryptionAlgorithm="RC4Stream"
                    msmqProtectionLevel="EncryptAndSign"
                    msmqSecureHashAlgorithm="Sha1"/>
                    </security>
                </binding>
q1.Send(new Message 
{
    BodyStream = new MemoryStream(
        Encoding.ASCII.GetBytes("ABCDEFGHIJKLMNOPQRSTUVXYZ")),
        Label = i.ToString(),
        //UseAuthentication = true,
        UseEncryption = true
}, msmqTx);
如果我打开身份验证,发送会再次变慢

q1.Send(new Message 
{
    BodyStream = new MemoryStream(
        Encoding.ASCII.GetBytes("ABCDEFGHIJKLMNOPQRSTUVXYZ")),
        Label = i.ToString(),
        //UseAuthentication = true,
        UseEncryption = true
}, msmqTx);
谢谢你的帮助

WindowsDomain身份验证意味着Kerberos身份验证。它必然是一个多代理协议,使用4+条不同的消息进行发送。因为您使用的是blocking.Send方法。如果不加入一些异步性/并发性,由于存在多个延迟路径,这将限制您的速率

q1.Send(new Message 
{
    BodyStream = new MemoryStream(
        Encoding.ASCII.GetBytes("ABCDEFGHIJKLMNOPQRSTUVXYZ")),
        Label = i.ToString(),
        //UseAuthentication = true,
        UseEncryption = true
}, msmqTx);
您可能会发现,切换到简单的证书身份验证就足够了

q1.Send(new Message 
{
    BodyStream = new MemoryStream(
        Encoding.ASCII.GetBytes("ABCDEFGHIJKLMNOPQRSTUVXYZ")),
        Label = i.ToString(),
        //UseAuthentication = true,
        UseEncryption = true
}, msmqTx);

结果是,服务器将在没有用户凭据的情况下执行消息,但将进行身份验证。您知道是谁发送了消息,但无法提升到该用户的权限。

尝试使用证书身份验证,但速度更慢65毫秒/秒。将通过使用系统解决此问题。消息,MessageQueue-对象而不是WCF。配置文件将受到以下影响:
q1.Send(new Message 
{
    BodyStream = new MemoryStream(
        Encoding.ASCII.GetBytes("ABCDEFGHIJKLMNOPQRSTUVXYZ")),
        Label = i.ToString(),
        //UseAuthentication = true,
        UseEncryption = true
}, msmqTx);