Skip to content

cluba-akia/Abp-MessageQueue-RabbitMq

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

abp-io-rabbitmq-notification

Abp-io projects with Microservice architecture implementing notification with rabbitmq.

  • Source project as Message Producer.
  • Destination project as Message Consumer.
  • RabbitMQ is the middleware which collects the messages from the Source Project and send to the Destination projects.

What does these application do?

This repository contains two solutions one is source and another is destination. After executing an API in source a dummy notification id is send to destination using rabbitmq.

Prerequisite

  1. ASP.NET 5
  2. SQL Server (SQL Server 2019 was used for developing)
  3. ABP CLI (For running RabbitMQ.Source.DbMigrator in Source)
  4. Erlang
  5. RabbitMQ
  6. Visual Studio (Good to have)

Architecture of these solutions

These projects are being utilized by both solutions and should be in same location as in the repository.

  1. RabbitMQ.Source.DbMigrator
  2. RabbitMQ.Source.Domain
  3. RabbitMQ.Source.Domain.Shared
  4. RabbitMQ.Source.EntityFrameworkcore

API is executed in source and the api sends data using local event bus within the same solution, and necessary notification steps should be done here like (generating notification, adding notification to database etc.). Then, it would send notification id to destination soludtion using distributed event bus, and it is here sending of notification step should be done.

Steps to follow

  1. Open both solutions and restore nuget packages.
  2. Set RabbitMQ.Source.HttpApi.Host and RabbitMQ.Destination.HttpApi.Host as startup projects.
  3. Run RabbitMQ.Source.DbMigrator
  • Right click on project
  • Debug
  • Start new instance (This will open a console application and create necessary tables in sql server will default seed data).
  1. Run both solutions.
  2. Two swaggers will open.
  3. Add breakpoint in RabbitMQ.Destination.Application > EventHandlers > EmailNotificationEventHandler > HandleEventAsync method.
  4. Execute WishBirthday api from source swagger.

Conclusion

These applications utilizes LocalEvent available in abp.io and rabbitmq to send data from one solution to another.

Additional resources

  1. Abp.io
  2. Abp.io docs
  3. Abp.io RabbitMQ integration 1
  4. Abp.io RabbitMQ integration 2
  5. Local Event Bus
  6. Distributed Event Bus

About

Microservices architecture.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 98.9%
  • Other 1.1%