0
votes

I have a scenario for a POC I am working. I am using Azure Service bus and using the Topic and Subscription model for my Event based message handling.

One of my Publisher publishes a message to Topic and same is ready by 3 Consumers (A, B and C). I want the Consumer C to process only after Consumer A has finished the processing of the message. Is something I can do with Azure Service Bus to control it?

1

1 Answers

0
votes

I am using Azure Service bus and using the Topic and Subscription model for my Event based message handling. ... I want the Consumer C to process only after Consumer A has finished the processing of the message.

When working with events, you're implementing Pub/Sub pattern which is intentionally decoupling between publishers and subscribers. In addition to that, it the idea is that subscribers are not related to each other and have no dependency on each other to process events they subscribe to. You do not have control over the timing when different subscribers would process the same event message and cannot promise any order of that message processing either.

For scenario such as the one you're describing, I would change the approach you're taking. When consumer A has to process event first (E1) and only then consumer C has to do the same, it feels as if there's another event (E2) that would encompass information from E1 plus the fact that consumer A was done. This would mean consumers A and B to subscribe to event E1, and consumer C to event E2, where consumer A would raise event E2.