From the course: Learning RabbitMQ

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Solution: Chatrooms

Solution: Chatrooms - RabbitMQ Tutorial

From the course: Learning RabbitMQ

Start my 1-month free trial

Solution: Chatrooms

(upbeat music) - [Instructor] To add chat rooms to our application, I'll first ask the user to specify the name of a chat room. So Console.WriteLine. Please specify a chat room. And then, our chatRoomName equals Console.ReadLine. Next, we'll change the Fanout exchange to a Direct exchange so that we can filter the messages. Because this exchange might still exist from our previous challenge, you can give the exchange a different name. Now, I'll just go with chat2. Now, the routing key is no longer irrelevant. On the contrary, the combination of the direct exchange and the routing key will allow us to receive only the messages from our chat room. So we'll need to change it where we bind the queue to our exchange. I'll just use the chatRoomName as the routing key, and then down here, where we publish the message, we also need to use the chatRoomName as the routing key. Now, let's run this. Again, Debug and Start Without…

Contents