【问题标题】:how to compress azure queue message (json string) to push and pull from azure storage queue如何压缩 azure 队列消息(json 字符串)以从 azure 存储队列中推送和拉取
【发布时间】:2016-04-07 13:34:39
【问题描述】:

Azure 存储队列的最大消息大小为 64Kb 我的消息可能超过此大小,我正在寻找压缩选项

我的代码如下所示

var json = JsonConvert.SerializeObject(item);
            CloudQueueMessage message = new CloudQueueMessage(json);              

            queue.AddMessageAsync(message);

在接收端

 public static void ProcessQueueMessage([QueueTrigger("abc")] AbcItem abcItem, TextWriter logger)
    {
        if (abcItem != null)
        {
            //processing
        }
    }

我的问题是这种压缩可以在 azure 队列上工作吗?是否可以在推送队列之前压缩此字符串并在处理之前将其从队列中拉出时在另一端解压缩?

【问题讨论】:

    标签: json azure azure-storage-queues


    【解决方案1】:

    是的,您可以将所有信息存储在队列中,因此压缩信息也可以使用。

    但是,即使是压缩文件也可能超过 64Kb,请查看此相关问题和答案:Azure Queue Storage: Send files in messages 用于将数据存储在 Blob 存储中,并且仅在队列中进行引用

    【讨论】:

      猜你喜欢
      • 2014-01-28
      • 2019-11-08
      • 1970-01-01
      • 2019-04-18
      • 2020-12-12
      • 1970-01-01
      • 1970-01-01
      • 2022-10-08
      • 2021-03-26
      相关资源
      最近更新 更多