Reputation: 151
I have looked around and searched, and I cannot find anything addressing this, so if my Google Fu has failed me, please just point me in the right direction.
We are using Azure Storage Queues to trigger execution of Azure Functions (V2). (I don't believe that this usage is relevant, but I'm including it just in case.) Over the course of developing the Function, the "shape" of the input data changed (I'm using C# POCO objects and serializing them to JSON to create the queue message content.)
What I discovered was that after pushing the code changes out to Azure, the Storage Queue was continuing to send the JSON message to the Function in the old object JSON format - even though the JSON provided to the Storage Queue was in the new format.
The fix was simple enough - delete the queue and let the code re-create it. However, there's a lot of confusion here:
CloudQueueMessage
object, so there is probably some sort of JSON goodness happening behind the scenes. But...Any answers anyone can provide/point me to would be greatly appreciated.
Upvotes: 0
Views: 1288
Reputation: 17790
You probably mistake message content with CloudQueueMessage
object.
What we usually handle in code is message content/text/body containing the information we want to process. In your case, i.e. C# POCO and the serialized Json payload.
When we create a queue message in Azure Storage Queue, several properties are populated by Azure. CloudQueueMessage
object is composed of message content and these properties. They are used to control how queue messages behave when we process its content, check the doc for their usage.
public static long MaxMessageSize { get; }
public static TimeSpan MaxVisibilityTimeout { get; }
public static int MaxNumberOfMessagesToPeek { get; }
public string Id { get; }
public string PopReceipt { get; }
public DateTimeOffset? InsertionTime { get; }
public DateTimeOffset? ExpirationTime { get; }
public DateTimeOffset? NextVisibleTime { get; }
public int DequeueCount { get; }
As for the message content itself, it can be a string or byte array. When Azure Function receives the message, we have several options how queue message are populated, the first three take message content only.
Upvotes: 0