Reputation: 5238
I am new to Azure Service Bus, I'm looking into whether it can replace our RabbitMQ infrastructure.
Anyway, I was wondering if there is a point in using Queues at all? If Topics and Subscriptions offer the same capabilities + provide the flexibility for consuming independently from multiple sources.
For example, if right now I have a setup with just a single consumer group (might be multiple consumers, but all sharing the same messages queue), I could work with a Topic that has a single subscription.
What is the point in Queues? Does it provide some sort of optimization over Topics and Subscriptions?
Upvotes: 2
Views: 1005
Reputation: 333
The main advantage of using a Topic rather than Queue, is that we can create multiple topic subscriptions within a Service Topic. So the messages sent to the topic will be sent to all the topic subscriptions and this will be very when there are multiple listeners listening to the messages from a single source.
Another main advantage is that we can create topic subscription rules or filters for each topic subscription to filter the messages received by that topic subscription. All the topic subscriptions will have default topic subscription rule which allows all the messages sent to that topic, to be received by that topic subscription.
Upvotes: -1
Reputation: 25994
Unlike topic with a subscription subscription, a queue doesn't have to go through filtering. Attachment large throughput this could translate in some performance benefit. Also, for scenarios where receiver is a single processor and destination is known, sending a message to a queue rather than publishing to a topic is a simpler semantic. Frameworks such as NServiceBus and MassTransit differentiate and optimize message sending based on whenever it's a command or an event, using queues or topics/events accordingly.
Upvotes: 5