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.
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.
- ASP.NET 5
- SQL Server (SQL Server 2019 was used for developing)
- ABP CLI (For running RabbitMQ.Source.DbMigrator in Source)
- Erlang
- RabbitMQ
- Visual Studio (Good to have)
These projects are being utilized by both solutions and should be in same location as in the repository.
- RabbitMQ.Source.DbMigrator
- RabbitMQ.Source.Domain
- RabbitMQ.Source.Domain.Shared
- 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.
- Open both solutions and restore nuget packages.
- Set RabbitMQ.Source.HttpApi.Host and RabbitMQ.Destination.HttpApi.Host as startup projects.
- 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).
- Run both solutions.
- Two swaggers will open.
- Add breakpoint in RabbitMQ.Destination.Application > EventHandlers > EmailNotificationEventHandler > HandleEventAsync method.
- Execute WishBirthday api from source swagger.
These applications utilizes LocalEvent available in abp.io and rabbitmq to send data from one solution to another.
Additional resources