2
votes

Azure storage queues have a maximum message size of 64Kb My messages can exceed this size and I am looking for an option to compress

My code looks like below

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

            queue.AddMessageAsync(message);

At the receiving end

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

My question is can this sort of compression work on azure queue and Is it possible to compress this string before pushing on the queue and uncompress at the other end when we are pulling it from the queue before processing?

1

1 Answers

2
votes

Yes, you can store all information in queues, so compressed information will work as well.

However, even a compressed file could exceed 64Kb, check out this related question and answer: Azure Queue Storage: Send files in messages for storing the data in Blob storage and only a reference in the queue