英文:
Difference Azure Queue and Topic with one catch-all Subscription?
问题
在Azure中,如果我创建一个队列或者一个具有一个全捕获订阅的主题,它们之间有什么区别?
简而言之:
我知道后续可以添加更多的订阅,也知道可以对订阅进行过滤,但这不是问题的一部分。
相同之处:都有一个死信队列。
相同之处:每条消息只被处理一次。
区别:?
英文:
If I, in Azure, create a
- Queue
or
- Topic with one catch-all Subscription
What is the difference?
TL;DR
I know that one can add more Subscriptions later on, and I know about filtering for the Subscriptions. But that is not part of the question.
Same: There is one dead letter queue.
Same: Each message gets handled once-and-only-once.
Difference: ?
答案1
得分: 1
你正在关注接收部分。真正的区别在于发送端。
- 当消息发送到队列时,发送方会针对特定目标。这种消息类型通常称为命令。
- 当消息发布到主题时,它将被零个或多个订阅者接收。这种消息类型通常称为事件。
在命令中,发送方和单个接收方耦合在一起。在事件中,发送方和接收方(们)是解耦的。
英文:
You're focusing on the receiving. The real difference is on the sending side.
- When a message is sent to a queue, the sender targets a specific destination. This message type is often called a command.
- When a message is published to a topic, it will be received by zero or more subscribers. This message type is often called an event.
With commands, the sender and the single receiver are coupled. With events, the sender and the receiver(s) are decoupled.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论