DanielG
DanielG

Reputation: 1675

Azure Service Bus or Queue

I have a process where I would like to use an Azure Queue or Service Bus to decouple the processing from the UI. A user will press a button, and I would like to place 2 messages in the queue, each with it's own topic. 1 set of competing consumers will process topic A, and another set process topic B. Only after both A and B complete, should a third process C start. Said another way, my first message should launch 2 processes in parallel (both are intense and need to start together), and then when both have successfully completed, a 3rd and final competing consumer should run to finish the task.

I am trying to avoid storing the success of process 1 and 2 in a DB or something, and instead do this all with a queue.

Thanks in advance...

Upvotes: 0

Views: 144

Answers (1)

Scott Brady
Scott Brady

Reputation: 5598

Sounds like you need an Azure Service Bus Topic for the first part (two queues, each with competing consumers). This will allow for the topic/subscription model you have described.

To automatically trigger another service after these have completed is not possible using a queue. This will require some sort of persistence layer to keep a track of that processes state.

To keep things decoupled, you could have processes A and B send completion messages to another queue. Then you could place a message pump at the end of this queue that can decide when to start process C.

Upvotes: 1

Related Questions