This project is a microservices-based application built using Java, Spring Boot, and Maven. It consists of several modules, each serving a specific purpose. The modules communicate with each other using REST APIs and messaging queues.
-
Customer Module
- Description: Manages customer-related operations.
- Communication: Communicates with the Fraud and Notification modules via REST APIs and RabbitMQ for messaging.
-
Fraud Module
- Description: Handles fraud detection for customer transactions.
- Communication: Receives customer data from the Customer module and sends notifications to the Notification module.
-
Notification Module
- Description: Sends notifications to customers.
- Communication: Receives messages from the Fraud and Customer modules via RabbitMQ.
-
Eureka Server
- Description: Service registry for managing microservices.
- Communication: All modules register with the Eureka server for service discovery.
-
API Gateway (apigw)
- Description: Acts as a gateway for routing requests to the appropriate microservices.
- Communication: Routes external requests to the Customer, Fraud, and Notification modules.
-
Postgres
- Description: Database service for storing application data.
- Communication: Used by the Customer, Fraud, and Notification modules for data persistence.
-
RabbitMQ
- Description: Message broker for asynchronous communication between microservices.
- Communication: Used by the Customer, Fraud, and Notification modules for sending and receiving messages.
-
Zipkin
- Description: Distributed tracing system for monitoring and troubleshooting microservices.
- Communication: Integrated with all modules to trace requests.
-
PgAdmin
- Description: Database management tool for Postgres.
- Communication: Used for managing the Postgres database.
- Customer Module: Sends customer data to the Fraud module for fraud detection. If fraud is detected, the Fraud module sends a notification to the Notification module.
- Fraud Module: Receives customer data from the Customer module and processes it for fraud detection. Sends notifications to the Notification module if fraud is detected.
- Notification Module: Receives messages from the Fraud and Customer modules and sends notifications to customers.
- Eureka Server: All modules register with the Eureka server for service discovery.
- API Gateway: Routes external requests to the appropriate microservices.
- RabbitMQ: Facilitates asynchronous communication between the Customer, Fraud, and Notification modules.
- Zipkin: Traces requests across all modules for monitoring and troubleshooting.
To run the project, use the docker-compose.yml
file to start all the services:
docker-compose up
This will start all the modules, including the database, message broker, and tracing system.
To register a customer, you can use swagger-ui to interact with the Customer module:
http://localhost:8080/swagger-ui.html#/customer-controller
You can access the Postgres database using PgAdmin:
The Eureka server dashboard can be accessed at:
The Zipkin dashboard can be accessed at:
RabbitMQ management UI can be accessed at: