From the course: Learning RabbitMQ: Efficient Message Queuing

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Solution: Chatrooms

Solution: Chatrooms

(upbeat music) - [Instructor] So here's how I added chat rooms to our application. First, we need the chat room name. So Console.WriteLine("Please specify a chat room"); and we'll capture the input from the user in the chatRoomName variable. There. We want to change the exchange type to a direct exchange so we can start filtering and there might still be an exchange from the previous challenge, so I'll call my exchange name now "chat2"; The routing key is no longer irrelevant now. 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 where we bind our queue to the exchange, we'll pass in the chat room name as routing key and where we publish the message, we also need to pass in the chat room name for the routing key. Now let's run this application. So dotnet run --project RabbitChat. In the other terminal I'll do the same.…

Contents