0
votes

I am working on Storage Queue and Functions using QueueTrigger, I also put BatchSize = 1 in host.json. I sure only serve one message at a time. I wondered is the message sent to the function is in order they arrived to the queue or not.

I have 4 data send to the queue which have a timestamp. I see one of them didn't get to the azure table stored which I used as an historical record. The one haven't got processed should be sent to the queue I think.

Later I sent another message to the queue but this message got processed than the one which sent earlier

1
Please be careful when tagging. For example, you used "table" which is ambiguous and even contains a description stating not to use it. I fixed your tagging.David Makogon

1 Answers

5
votes

No. There is no order guarantee when using Function to process Queues. The idea of Function is that is scales automatically and process in parallel. This from one side. From the other side, using Azure Storage Qeueues, there is no FIFO guarantee. The only Queue that guarantees FIFO processing is Azure Service Bus Queue when used with Sessions. But sessions are not supported in Azure Functions. More info on Storage Queues and Service Bus Queues comparison is here. And the Info on missing Session support in Functions here.

However, if you just store the messages in a Storage Table, you may achieve that goal. You have to put a timestamp in your message when you send it. Then use that property saving into the Storage and make it part of the RowKey.