This project demonstrates Event Driven Microservice Messaging. The architecture involves two key events: ArticleCreatedEvent
and ArticleViewedEvent
.
- ArticleCreatedEvent: Triggered when an article is created.
- ArticleViewedEvent: Triggered when an article is viewed.
-
CreateArticle Service:
- Functionality: Allows users to create new articles.
- Event: Publishes
ArticleCreatedEvent
upon article creation.
-
Newsletter API:
- Functionality: Retrieves article information.
- Event: Publishes
ArticleViewedEvent
when an article is accessed.
-
ArticleCreatedConsumer:
- Consumes
ArticleCreatedEvent
. - Action: Writes article creation data to the database.
- Consumes
-
ArticleViewedConsumer:
- Consumes
ArticleViewedEvent
. - Action: Logs article view information to the database.
- Consumes
-
Article Creation:
- User creates an article via the
CreateArticle
service. - This triggers
ArticleCreatedEvent
. - The
ArticleCreatedConsumer
processes this event and stores the data in the database.
- User creates an article via the
-
Article Viewing:
- User views an article via the
Newsletter API
. - This triggers
ArticleViewedEvent
. - The
ArticleViewedConsumer
processes this event and logs the view in the database.
- User views an article via the
- .NET for backend development.
- Event-driven architecture for scalable and decoupled service communication.
- Message brokers (e.g., RabbitMQ, Kafka) for event handling.
- Clone the repository:
git clone https://github.com/alikrc/MicroServiceMessaging.git
- Set up the necessary environment variables and configuration files.
- Build and run the services using your preferred method (e.g., Docker, .NET CLI).
- Implement additional events for more granular tracking.
- Add more consumers for advanced processing and analytics.
- Integrate with a front-end application for a complete user experience.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes. License
This project is licensed under the MIT License. See the LICENSE file for details.