0
votes

say I have this:

Step 1: A azure webjob triggered by a timer, and this job will create 1000 messages and I will put them in a queue.

Step 2: I have another azure webjob triggered by above message queue, this webjob will process these messages.

Step 3: The final webjob should only be triggered when all messages have been processed by step 2.

Looks like azure Queue doesn't support ordering and the only way is to use ServiceBus. I am wondering is it really the only way?

What I am thinking is this kind of process:

  1. Put all these messages into an azure table, with some guid as primary key and status to be 0.

  2. after finishing step 2, change the status of this message to 1 (i.e. finished) and will trigger step 3 if every messages have been done.

Will it work? Or maybe there are some nuget packages that I can use to achieve what I want?

1
no, I haven't got time to look into logic app yet. Instead I implemented my originally thought and gave that a try firstdaxu

1 Answers

0
votes

The simplest way I think is the combination of Azure Logic App and Azure Function.

Logic App is a automated scalable workflow, you could trigger it with Timer, HTTP request and etc. And Azure function is a serverless compute service that enables you to run code on-demand without having to explicitly provision or manage infrastructure.

The Logic App support add code with Function, as for the use of Function, It's similar with WebJob. So I think you could create a Logic App with three Function, the they will run one by one.

As for the WebJob, yes,the QueueTrigger doesn't support ordering. And the Service Bus you mentioned, It did meet your some requirements for its FIFO feature. However you need to make sure your step 3 would be triggered after step 1, because it's already null in your queue before creating queues.

Hope my answer could help you.