Skip to content

A project example using RabbitMQ and .Net Core 6 (console)

License

Notifications You must be signed in to change notification settings

anzolin/RabbitMQNetCore

Repository files navigation

Contributors Watchers Stargazers Forks Issues MIT License


RabbitMQ and .Net Core

A project example using RabbitMQ and .Net Core 6 (console).

What is RabbitMQ?

RabbitMQ is an open source message broker software. It accepts messages from producers, and delivers them to consumers. It acts like a middleman which can be used to reduce loads and delivery times taken by web application servers.

I recommend you visit the project website and even the tutorials page.

The project

This project consists of three sub-projects, which are:

  • RabbitMQNetCore: a class project containing a class to type our message and also classes with the rules for sending and consuming the message.
  • RabbitMQNetCore.Publisher: a console project responsible for running the publisher.
  • RabbitMQNetCore.Consumer: a console project responsible for running the consumer.

Could I have created a single project, yes I could, but I wanted to separate it for a better understanding of what each one does.

How to run?

First we need to run the RabbitMQ service, I recommend that you make use of a Docker image, so you need to have Docker installed and run the following command:

docker run -d --hostname localhost --name localrabbit -e RABBITMQ_DEFAULT_USER=user -e RABBITMQ_DEFAULT_PASS=password rabbitmq:3-management

This command will create and run an instance of RabbitMQ.

Run the Publisher project:

dotnet run --project .\RabbitMQNetCore.Publisher\RabbitMQNetCore.Publisher.csproj

Run the Consumer project:

dotnet run --project .\RabbitMQNetCore.Consumer\RabbitMQNetCore.Consumer.csproj

Now, in the Publisher console, you can perform tests by sending messages and monitoring the consumption of the same in the Consumer console.

This is a simple project to demonstrate how the messaging service works.

License

This project is MIT Licensed.

About the author

Hello everyone, my name is Diego Anzolin Ferreira. I'm a .NET developer from Brazil. I hope you will enjoy this project as much as I enjoy developing it. If you have any problems, you can post a GitHub issue. You can reach me out at diego@anzolin.com.br.

Donate

Want to help me keep creating open source projects, make a donation:

Donate Donate

Thank you!

About

A project example using RabbitMQ and .Net Core 6 (console)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages