
Using var channel = connection.CreateModel() Var connection = factory.CreateConnection() Then, we want to create a connection to the RabbitMQ server in the SendMessage method: var factory = new ConnectionFactory Now we are going to implement this interface, using the RabbitMQProducer class: public class RabbitMQProducer : IMessageProducer NET/C# content and get paid? > JOIN US! (T message) Wanna join Code Maze Team, help us produce more awesome. So why would we choose RabbitMQ, over something such as Azure Service Bus or Amazon Simple Queue Service? We can apply the same argument of loosely coupled applications to that of our choice of a message broker. Using a message queue, we can have multiple Subscribers which would each take one or more messages off the queue and process them, without affecting the performance of our Producer or overall application. For example, we can use messages to inform Subscribers of a long-running task that needs processing. Having a message broker, like RabbitMQ, manage our inter-application communication, allows our system as a whole to scale much easier. As long as we keep the message contract the same we can change Producers and Subscribers independently of each other. When we introduce message queues into our application architecture, our Producers and Subscribers don’t have to be aware of each other.

We don’t want to create tight coupling between our applications, because doing so would mean we couldn’t independently change one application without causing breaking changes in another application. Message queues allow us to build decoupled applications while improving the performance, reliability, and scalability of our applications. What Are the Advantages of Message Queues?
