可以添加到Azure队列的base64编码的字符串的最大长度是多少? [英] What is the maximum length of base64 encoded string that can be added to Azure queue?

查看:118
本文介绍了可以添加到Azure队列的base64编码的字符串的最大长度是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要通过Azure队列发送压缩的Base64数据,其限制为64K。

我的代码压缩数据,然后将其编码为Base64字符串。

我确认压缩和编码后的字符串没有超过64000字节(请参阅下面的encodeLen),但是,当我尝试添加〜57,000 bytes的消息时,我的代码崩溃了。

I need to send compressed Base64 data over an Azure queue, which has a limitation of 64K.
My code compresses the data and then encodes it as a Base64 string.
I verify the compressed and encoded string does not exceed 64000 bytes (see encodedLen below), however, my code crashed when I tried to add a message of ~57,000 bytes .

var byteString = Encoding.UTF8.GetBytes(articleDataToSend);  
var compressed = QuickLZ.compress(byteString, 1);  
var encoded = Convert.ToBase64String(compressed);  

var encodedLen = Encoding.UTF8.GetByteCount(encoded);  
if(encodedLen < 64000)
{
    QueueMessage(_nlpInputQueue, encoded);
}

我正在使用Visual Studio 2012和.Net 4.5。

我在这里缺少什么?

I'm using Visual Studio 2012 and .Net 4.5.
What am I missing here?

推荐答案

使用Base64编码时,最大邮件大小为48k
http://msdn.microsoft.com/en-us/library/windowsazure/hh767287。 aspx

Maximum message size is 48k when using Base64 encoding http://msdn.microsoft.com/en-us/library/windowsazure/hh767287.aspx

使用Azure Service Bus队列,您最多可以获取256k

Use Azure Service Bus Queues and you can get up to 256k

这篇关于可以添加到Azure队列的base64编码的字符串的最大长度是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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