可以添加到Azure队列的base64编码的字符串的最大长度是多少? [英] What is the maximum length of base64 encoded string that can be added to Azure queue?
问题描述
我需要通过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屋!