Hi all.
I'm starting to use MassTransit 3 over Azure Service Bus, and trying to build an understanding of how MassTransit uses ASB queues/topics, how messages go from publisher to subscriber, and how this differs to a plain old Azure Service Bus configuration without MassTransit.
Consider I have a publisher called MyPublisher which sends a message called MyMessage. I subscribe to this message with MySubscriber.
1. MyPublisher process sends MyMessage to a queue in ASB called xxx_MyPublisher_xxx (I'll call this the "publisher instance" queue)
2. The message is removed from the xxx_MyPublisher_xxx queue and is sent to the MyMessage topic (I assume that the MyPublisher process does this?)
3. The message is removed from the MyMessage topic and is sent to the MySubscriber queue (I'll call this the "subscription queue". I assume that ASB does this as I can see the subscription has a "forward to" configured)
4. The message is removed from the MySubscriber queue and is sent to a queue called xxx_MySubscriber_xxx (I'll call this the "subcriber instance" queue. I assume that the MySubscriber process does this?)
5. The message is removed from the xxx_MySubscriber_xxx queue by the MySubscriber process.
In comparison, the equivalent functionality using plain old ASB without MassTransit results in a single topic being created. Now, the end-to-end process is...
a. MyPublisher process sends MyMessage to the MyMessage topic
b. The message is removed from the MyMessage topic by the MySubscriber process.
What benefit do we get from MassTransit publishing to the "publisher instance queue", the "subscription queue" and the "subscriber instance" queue when using ASB? I can understand why this would be important if the instance queues were physically local to the publisher/subscriber process, as this would protect us from an unreliable network connection. However, given these queues/topics are all running in the cloud is there actually any benefit? Is this a fundamental part of the mass transit architecture or is there any way to configure this behaviour so that the ASB transport publishes straight to the ASB topic/subscriber?
I believe that the billing in ASB is per message per queue, so the fact that I'm now seeing 5 MassTransit steps rather than 2 ASB steps means that adopting MassTransit over ASB has a financial impact that might be difficult to justify.
Thanks,
Phil.