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.
Publish to a RabbitMQ exchange - RabbitMQ Tutorial
From the course: Learning RabbitMQ: Efficient Message Queuing
Publish to a RabbitMQ exchange
- [Instructor] We know how our sample application works, so let's add some code to send a message. First, let me double check if my service is running by navigating to localhost at port 15672. Now I see the RabbitMQ management UI, so I know it's running. To get started, add the RabbitMQ NuGet package to the project. I'll be using the command line, so it's dotnet add, specifying the WebApp project package RabbitMQ.Client. Now, if you're using Visual Studio or another IDE, you can of course also use the UI to add this package. Now in the BookingController, let's add a using statement using RabbitMQ.Client and using System.Text, which I'll be using later on. The first thing we need is a connection, and to get, that we need a connection factory. So var factory = new ConnectionFactory() and we'll need to tell this factory where our RabbitMQ instance is running. So I'll do this by setting the URI property, specifying…
Contents
-
-
-
-
Introducing the sample application2m 22s
-
(Locked)
Publish to a RabbitMQ exchange4m 39s
-
(Locked)
Consuming from a RabbitMQ exchange4m 5s
-
(Locked)
Filter messages with direct exchanges5m 8s
-
(Locked)
Filter messages with topic exchanges5m 55s
-
(Locked)
Filter messages with headers exchanges6m 45s
-
(Locked)
Challenge: A simple chat application1m 10s
-
(Locked)
Solution: A simple chat application5m 20s
-
(Locked)
Challenge: Chatrooms1m 13s
-
(Locked)
Solution: Chatrooms2m 17s
-
-
-