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
- Manages customer-related operations.
- Communicates with the Fraud and Notification modules via REST APIs and RabbitMQ for messaging.
-
Fraud Module
- Handles fraud detection for customer transactions.
- Receives customer data from the Customer module and sends notifications to the Notification module.
-
Notification Module
- Sends notifications to customers.
- Receives messages from the Fraud and Customer modules via RabbitMQ.
-
Eureka Server
- Service registry for managing microservices.
- All modules register with the Eureka server for service discovery.
-
API Gateway (apigw)
- Acts as a gateway for routing requests to the appropriate microservices.
- Routes external requests to the Customer, Fraud, and Notification modules.
-
Postgres
- Database service for storing application data.
- Used by the Customer, Fraud, and Notification modules for data persistence.
-
RabbitMQ
- Message broker for asynchronous communication between microservices.
- Used by the Customer, Fraud, and Notification modules for sending and receiving messages.
-
Zipkin
- Distributed tracing system for monitoring and troubleshooting microservices.
- Integrated with all modules to trace requests.
-
PgAdmin
- Database management tool for Postgres.
- 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 upThis 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:
