Search code examples
c#rabbitmqmicroservices

rabbitmq what is difference between SubscribeAsync and PublishAsync in C#


I'm using rabbitmq in my microservices project and I saw these two methods what are these and when do we use each

enter image description here

enter image description here


Solution

  • I suspect you're using something on top of RMQ, like EasyNetQ, because these aren't rabbit terms specifically, but in essence:

    Publish publishes messages to a queue

    Subscribe subscribes to a queue and defines the code that will act on the received message