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.

Publish to a RabbitMQ exchange

Publish to a RabbitMQ exchange - RabbitMQ Tutorial

From the course: Learning RabbitMQ

Start my 1-month free trial

Publish to a RabbitMQ exchange

- [Instructor] We know how our sample application works, so let's add some code to send a message. If it's not already running, start the RabbitMQ service. In the start menu, go to the RabbitMQ folder, and click on the start link. To verify that the service is running, go to localhost at port 15672, and if you see your log in screen, then your RabbitMQ service is running. To get started, in the web application, open the Nuget Package Manager. Click on the Browse tab, and search for rabbitmq.client, and go ahead and install this package. In the Controllers folder, you can open the BookingController, and add a using statement using RabbitMQ.Client. The first thing we need is a connection to the RabbitMQ instance. To create this, create a new instance of the ConnectionFactory class. The factory needs a URI. This is the uniform resource identifier. It tells the ConnectionFactory where our instance is located. You can…

Contents