rabbitmq C# 中的 SubscribeAsync 和 PublishAsync 有什么区别

rabbitmq what is difference between SubscribeAsync and PublishAsync in C#

我在我的微服务项目中使用了 rabbitmq,我看到了这两种方法 这些是什么以及我们什么时候使用它们

我怀疑您在 RMQ 之上使用某些东西,例如 EasyNetQ,因为这些并不是专门针对兔子的术语,但本质上是:

Publish 将消息发布到队列

订阅队列并定义将对接收到的消息起作用的代码

A producer is a user application that sends messages while a consumer is a user application that receives messages.A queue is a buffer that stores those messages. https://dev.to/mashaa/introduction-to-rabbitmq-49n8

In many pub/sub systems, publishers post messages to an intermediary message broker or event bus, and subscribers register subscriptions with that broker, letting the broker perform the filtering. The broker normally performs a store and forward function to route messages from publishers to subscribers. In addition, the broker may prioritize messages in a queue before routing. https://en.m.wikipedia.org/wiki/Publish–subscribe_pattern

The core idea in the messaging model in RabbitMQ is that the producer never sends any messages directly to a queue. Actually, quite often the producer doesn’t even know if a message will be delivered to any queue at all. https://www.rabbitmq.com/tutorials/tutorial-three-python.html