MicroBank360

Enterprise Microservices Banking Platform

Java Spring Boot Spring Cloud MySQL Microservices

Architecture Overview

MicroBank360 is a production-grade banking platform built on modern microservices architecture principles, designed for scalability, resilience, and maintainability. The system implements core banking functionalities with clean separation of concerns and well-defined service boundaries.

Client Layer
Postman
API Testing Client
Primary testing interface during development
Web/Mobile Clients
Future Integration
React/Angular frontends planned
API Gateway Layer
Spring Cloud Gateway
Port: 8080
• Routing & Load Balancing
• Service Discovery
• Future: Authentication
Service Discovery
Eureka Server
Port: 8761
• Heartbeat monitoring
• Instance Lookup
• Load balancing
Microservices Layer
Customer Service
Port: 8081
• Spring Data JPA
• OpenFeign Client
• REST API
OpenFeign
Inter-service Communication
Customer → Account Service
(Get customer accounts)
Account Service
Port: 8082
• Account CRUD
• Balance Management
• REST API
WebClient
Data Seeder Service → Services
Data Seeder Service
Port: 8088
• DataFaker Integration
• Batch Processing
• CSV Export
Database Layer
MySQL Customer DB
Port: 3306
• Isolated database
• Customer data only
MySQL Account DB
Port: 3306
• Isolated database
• Account data only

High-Level Architecture Diagram

graph TD subgraph Client_Layer["Client Layer"] UI[Web/Mobile Clients] PM[Postman] end subgraph Gateway_Layer["API Gateway Layer"] GW[Spring Cloud Gateway] end subgraph Discovery_Layer["Service Discovery"] EU[Eureka Server] end subgraph Service_Layer["Microservices Layer"] CS[Customer Service] AS[Account Service] DS[Data Seeder Service] end subgraph Data_Layer["Database Layer"] CDB[(Customer DB)] ADB[(Account DB)] end UI --> GW PM --> GW GW --> EU GW --> CS GW --> AS GW --> DS CS -->|OpenFeign| AS DS -->|WebClient| CS DS -->|WebClient| AS CS --> CDB AS --> ADB CS --> EU AS --> EU DS --> EU style Client_Layer fill:#f5f6fa,stroke:#2f3640 style Gateway_Layer fill:#487eb0,stroke:#2f3640,color:white style Discovery_Layer fill:#4cd137,stroke:#2f3640,color:white style Service_Layer fill:#40739e,stroke:#2f3640,color:white style Data_Layer fill:#718093,stroke:#2f3640,color:white

Key Architectural Decisions

Horizontal Scalability

Each service can be independently scaled based on demand, with Eureka handling service discovery for dynamic scaling.

Resilient Communication

OpenFeign with client-side load balancing ensures resilient inter-service communication with automatic retry mechanisms.

Performance Optimized

Reactive programming model in the API Gateway ensures non-blocking I/O for high throughput scenarios.

Decoupled Services

Each service maintains its own database, enforcing strict boundaries and enabling independent evolution.

Data Management

Dedicated Data Seeder Service with circuit breakers and batch processing for scalable data generation.

Testing Ready

Built-in CSV export capabilities for JMeter and other performance/load testing tools.

Technology Stack

Java 17 Spring Boot 3 Spring Cloud MySQL 8 Spring Data JPA OpenFeign Eureka Server Spring Cloud Gateway Spring Cloud LoadBalancer Maven JUnit 5 Lombok Postman DataFaker OpenCSV Resilience4j WebFlux JMeter

Core Services

The platform currently implements three core microservices with well-defined boundaries and comprehensive APIs:

Customer Service

Manages all customer-related data and operations with full CRUD capabilities and account relationship management.

Key Responsibilities:

  • Customer registration and profile management
  • Customer data validation and enrichment
  • Account relationship aggregation (via OpenFeign)
  • Data persistence and retrieval

Database Schema:

CREATE TABLE customers (
    id BIGINT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(100) NOT NULL,
    email VARCHAR(100) UNIQUE NOT NULL,
    phone VARCHAR(20) NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

Customer Lookup Sequence

sequenceDiagram participant Client participant Gateway participant CustomerService participant AccountService Client->>Gateway: GET /customer/123 Gateway->>CustomerService: Forward request CustomerService->>AccountService: GET /account/customer/123 (OpenFeign) AccountService-->>CustomerService: Account data CustomerService-->>Gateway: Combined response Gateway-->>Client: Customer with accounts

Account Service

Handles all account operations including creation, balance management, and customer account relationships.

Key Responsibilities:

  • Account creation and management
  • Balance tracking and updates
  • Transaction processing (future)
  • Customer account relationship management

Database Schema:

CREATE TABLE accounts (
    id BIGINT AUTO_INCREMENT PRIMARY KEY,
    account_number VARCHAR(20) UNIQUE NOT NULL,
    account_type ENUM('SAVINGS', 'CURRENT', 'LOAN') NOT NULL,
    balance DECIMAL(15,2) NOT NULL DEFAULT 0.00,
    customer_id BIGINT NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
);

Account Creation Sequence

sequenceDiagram participant Client participant Gateway participant AccountService participant CustomerService Client->>Gateway: POST /account Gateway->>AccountService: Forward request AccountService->>CustomerService: Verify customer exists (OpenFeign) CustomerService-->>AccountService: Customer validation AccountService->>AccountService: Create account AccountService-->>Gateway: Success response Gateway-->>Client: Account created

Data Seeder Service

MicroBank360 implements a dedicated Data Seeder Service as a standalone microservice for generating realistic test data at scale. This production-grade approach separates data generation concerns from business logic while providing comprehensive testing capabilities.

Core Components:
  • Port: 8088
  • Service Name: DATA-SEEDER-SERVICE
  • Communication: WebClient (Reactive)
  • Discovery: Eureka Client
  • Resilience: Resilience4j Circuit Breaker
  • Data Source: DataFaker Library
Key Features:
  • API-Based Generation: RESTful endpoints for data creation
  • Realistic Data: DataFaker library integration
  • Batch Processing: Configurable batch sizes
  • CSV Export: JMeter-optimized data export
  • Circuit Breaker: Fault tolerance patterns
  • Reactive Streams: Non-blocking operations
  • Rate Limiting: Configurable request delays
Benefits:
✓ Production Safety - No seeding in business services
✓ Performance Testing Ready - JMeter data export
✓ Scalable Data Generation - Batch processing
✓ Fault Tolerant - Circuit breaker patterns
✓ Separation of Concerns - Dedicated service

Data Seeding Architecture

flowchart TD subgraph Client_Layer["Client Requests"] HTTP[HTTP Requests] PM[Postman Collections] end subgraph Seeder_Service["Data Seeder Service Port: 8088"] API[REST API Controller] SVC[Data Generation Service] CB[Circuit Breaker] DF[DataFaker Library] end subgraph Service_Clients["Service Communication"] CSC[Customer Service Client] ASC[Account Service Client] end subgraph Target_Services["Target Services"] CS[Customer Service] AS[Account Service] end subgraph Export_Layer["Export Capabilities"] CSV[CSV Export] JMETER[JMeter Data] end HTTP --> API PM --> API API --> SVC SVC --> CB CB --> CSC CB --> ASC CSC -->|WebClient| CS ASC -->|WebClient| AS SVC --> DF SVC --> CSV CSV --> JMETER

API Documentation

Method Endpoint Description Request Body Response
GET /customer List all customers with their accounts None Customer[]
GET /customer/{id} Get customer by ID with accounts None Customer
POST /customer Create new customer CustomerDTO Customer
PUT /customer/{id} Update customer CustomerDTO Customer
DELETE /customer/{id} Delete customer None 204 No Content

Data Transfer Objects

CustomerDTO (Input)
{
  "name": "string (required, min 2)",
  "email": "string (required, email format)",
  "phone": "string (required)"
}
Customer (Output)
{
  "id": "long",
  "name": "string",
  "email": "string",
  "phone": "string",
  "createdAt": "timestamp",
  "updatedAt": "timestamp",
  "accounts": "Account[]"
}
Method Endpoint Description Request Body Response
GET /account List all accounts None Account[]
GET /account/{id} Get account by ID None Account
POST /account Create new account AccountDTO Account
PUT /account/{id}/{balance} Update account balance None Account
DELETE /account/{id} Delete account None 204 No Content
GET /account/customer/{customerId} Get accounts by customer ID None Account[]

Data Transfer Objects

AccountDTO (Input)
{
  "accountNumber": "string (required)",
  "accountType": "enum (SAVINGS|CURRENT)",
  "balance": "decimal (min 0)",
  "customerId": "long (required)"
}
Account (Output)
{
  "id": "long",
  "accountNumber": "string",
  "accountType": "string",
  "balance": "decimal",
  "customerId": "long",
  "createdAt": "timestamp",
  "updatedAt": "timestamp"
}
Method Endpoint Description Parameters Response
POST /seed/customers/{count} Generate specified number of customers count (path) CustomerResponse[]
POST /seed/accounts Generate accounts for existing customers minAccountsPerCustomer, maxAccountsPerCustomer AccountResponse[]
POST /seed/full-dataset Generate complete dataset (customers + accounts) customerCount, minAccountsPerCustomer, maxAccountsPerCustomer DatasetResponse
GET /seed/export/jmeter-data.csv Export JMeter-ready combined data as CSV None CSV File
GET /seed/export/customers.csv Export all customers as CSV None CSV File
GET /seed/export/accounts.csv Export all accounts as CSV None CSV File
GET /seed/stats Get seeding statistics None StatisticsResponse
DELETE /seed/cleanup Clean up all seeded data None 200 OK

Implementation Details

Data Generation
  • DataFaker library integration
  • Realistic customer profiles
  • Multiple account types
  • Unique email and account number generation
  • Configurable balance ranges
Performance & Resilience
  • Reactive programming with WebFlux
  • Circuit breaker patterns
  • Configurable batch processing
  • Retry mechanisms
Export & Integration
  • CSV export for testing
  • JMeter-optimized data format
  • Configurable export directory
  • Statistics and monitoring
  • Data cleanup capabilities
  • RESTful API integration

Service Implementation

Service Architecture

The Data Seeder Service is implemented as a reactive microservice with fault tolerance

WebClient Configuration

Reactive WebClient with circuit breaker integration

Circuit Breaker Integration

Resilience4j configuration for fault tolerance

Running the Data Seeder

Start the Data Seeder Service and generate test data

Infrastructure Components

Service Discovery (Eureka)

The Eureka server acts as the central registry for all microservices, enabling dynamic service discovery and load balancing.

Key Features:

  • Automatic service registration and deregistration
  • Health monitoring via heartbeats
  • Zone awareness for high availability
  • Integration with Spring Cloud LoadBalancer

Configuration:

# application.yml
eureka:
  client:
    registerWithEureka: false
    fetchRegistry: false
  server:
    enable-self-preservation: true
    eviction-interval-timer-in-ms: 5000

API Gateway

The Spring Cloud Gateway serves as the single entry point for all client requests, handling routing, load balancing, and cross-cutting concerns.

Key Features:

  • Dynamic routing based on Eureka service IDs
  • Load balancing across service instances
  • Request/response modification
  • Future: JWT validation and rate limiting

Route Configuration:

spring:
  cloud:
    gateway:
      routes:
        - id: customer-service
          uri: lb://CUSTOMER-SERVICE
          predicates:
            - Path=/customer/**
        - id: account-service
          uri: lb://ACCOUNT-SERVICE
          predicates:
            - Path=/account/**

Inter-Service Communication

Services communicate through REST APIs using OpenFeign for declarative client creation, with Spring Cloud LoadBalancer distributing requests across available instances.

sequenceDiagram participant Client participant Gateway participant CustomerService participant AccountService participant Eureka Client->>Gateway: GET /customer/123 Gateway->>Eureka: Locate CustomerService Eureka-->>Gateway: Service instances Gateway->>CustomerService: Forward request CustomerService->>Eureka: Locate AccountService Eureka-->>CustomerService: Service instances CustomerService->>AccountService: GET /account/customer/123 AccountService-->>CustomerService: Account data CustomerService-->>Gateway: Combined response Gateway-->>Client: Final response

Circuit Breaker (Resilience4j)

Fault tolerance implementation in our Data Seeder Service, providing resilient inter-service communication with automatic failure detection and recovery.

Implementation:

  • • Separate circuit breakers for Customer and Account service clients
  • • Integrated with reactive WebClient for non-blocking operations
  • • Automatic failure detection with configurable thresholds
  • • Exponential backoff retry with 3 attempts and 1-second delays
  • • Fallback mechanisms for graceful degradation

Reactive Communication (WebFlux)

Data Seeder Service implements full reactive programming using WebFlux and WebClient for high-throughput, non-blocking data generation and CSV export operations.

Implementation:

  • • WebClient with @LoadBalanced annotation for service discovery
  • • Reactive controllers returning Mono<ResponseEntity>
  • • Non-blocking I/O with configurable timeouts (5s connect, 30s read)
  • • Netty HTTP client with connection pooling (max 200 connections)
  • • Batch processing with reactive streams (Flux.buffer)

Data Generation Engine (DataFaker + Batch Processing)

Test data generation infrastructure built into our Data Seeder Service, featuring realistic data creation, batch processing, and comprehensive CSV export capabilities.

Implementation:

  • • DataFaker library integration for realistic customer profiles
  • • Configurable batch processing (default: 100 records per batch)
  • • Rate limiting with 10ms delays between requests
  • • Unique constraint handling for emails and account numbers
  • • Different account types
  • • Account-type-specific balance generation

CSV Export Pipeline

Data export system built into our Data Seeder Service, providing JMeter-optimized CSV files for performance testing and data analysis.

Our Export System Features:

  • • Three export endpoints: customers.csv, accounts.csv, jmeter-data.csv
  • • Combined customer-account data export for JMeter consumption
  • • Proper CSV escaping for special characters and commas
  • • Reactive streaming for memory-efficient large dataset exports

Advanced Inter-Service Communication Patterns

Our system implements multiple communication patterns: synchronous OpenFeign for Customer↔Account communication, reactive WebClient with circuit breakers for Data Seeder operations, and centralized routing through the API Gateway.

sequenceDiagram participant Client participant Gateway participant DataSeeder participant CircuitBreaker participant CustomerService participant AccountService participant DataFaker Client->>Gateway: POST /seed/full-dataset?customerCount=1000 Gateway->>DataSeeder: Route via lb://DATA-SEEDER-SERVICE DataSeeder->>DataFaker: Generate realistic customer data DataFaker-->>DataSeeder: CustomerRequest objects DataSeeder->>DataSeeder: Process in batches (100 records) DataSeeder->>CircuitBreaker: WebClient.post() to Customer Service CircuitBreaker->>CustomerService: Batch customer creation CustomerService-->>CircuitBreaker: CustomerResponse objects CircuitBreaker-->>DataSeeder: Success/Fallback response DataSeeder->>DataFaker: Generate account data for customers DataFaker-->>DataSeeder: AccountRequest objects DataSeeder->>CircuitBreaker: WebClient.post() to Account Service CircuitBreaker->>AccountService: Batch account creation AccountService-->>CircuitBreaker: AccountResponse objects CircuitBreaker-->>DataSeeder: Success/Fallback response DataSeeder-->>Gateway: Combined dataset with metrics Gateway-->>Client: Complete response with execution time
sequenceDiagram participant Client participant APIGateway participant DataSeeder participant CircuitBreaker as Circuit Breaker participant CustomerServiceClient participant AccountServiceClient participant CustomerService participant AccountService participant CustomerDB as Customer Database participant AccountDB as Account Database participant DataFaker Note over DataSeeder: Three Main Operations:
1. Generate Customers
2. Generate Accounts for Existing Customers
3. Full Dataset Generation %% Operation 1: Generate New Customers rect rgb(200, 230, 255) Note over Client, DataFaker: Scenario 1: Generate New Customers Client->>APIGateway: POST /seed/customers/500 APIGateway->>DataSeeder: Route to DATA-SEEDER-SERVICE DataSeeder->>DataSeeder: Check usedEmails Set (in-memory) DataSeeder->>DataFaker: Generate unique customer data DataFaker-->>DataSeeder: CustomerRequest objects (batch of 100) loop Batch Processing (500 customers in batches of 100) DataSeeder->>CustomerServiceClient: createCustomersBatch : List CustomerRequest CustomerServiceClient->>CircuitBreaker: Apply circuit breaker protection CircuitBreaker->>CustomerService: POST /customer (WebClient) CustomerService->>CustomerDB: INSERT INTO customers CustomerDB-->>CustomerService: Customer saved with ID CustomerService-->>CircuitBreaker: CustomerResponse CircuitBreaker-->>CustomerServiceClient: Success/Fallback CustomerServiceClient-->>DataSeeder: List CustomerResponse DataSeeder->>DataSeeder: delayElement(10ms) - Rate limiting end DataSeeder-->>APIGateway: Success response with count & metrics APIGateway-->>Client: 500 customers created end %% Operation 2: Generate Accounts for Existing Customers ONLY rect rgb(200, 255, 200) Note over Client, DataFaker: Scenario 2: Accounts for Existing Customers ONLY Client->>APIGateway: POST /seed/accounts?minAccountsPerCustomer=1&maxAccountsPerCustomer=3 APIGateway->>DataSeeder: Route to DATA-SEEDER-SERVICE %% First: Fetch ALL existing customer IDs DataSeeder->>CustomerServiceClient: getAllCustomerIds() CustomerServiceClient->>CustomerService: GET /customer (WebClient) CustomerService->>CustomerDB: SELECT * FROM customers CustomerDB-->>CustomerService: All existing customers CustomerService-->>CustomerServiceClient: Flux CustomerResponse CustomerServiceClient->>CustomerServiceClient: .map(CustomerResponse::getId) CustomerServiceClient-->>DataSeeder: Flux Long customerIds DataSeeder->>DataSeeder: .collectList() to List Long customerIds alt No existing customers found DataSeeder-->>APIGateway: customersProcessed: 0, accountsGenerated: 0, message: No existing customers found else Existing customers found loop For each existing customer ID DataSeeder->>DataSeeder: Generate random account count (1-3) DataSeeder->>DataFaker: Generate account data for customerId DataFaker-->>DataSeeder: AccountRequest with customerId DataSeeder->>DataSeeder: Check usedAccountNumbers Set end loop Batch Processing (accounts in batches of 100) DataSeeder->>AccountServiceClient: createAccountsBatch : List AccountRequest AccountServiceClient->>CircuitBreaker: Apply circuit breaker protection CircuitBreaker->>AccountService: POST /account WebClient AccountService->>AccountDB: INSERT INTO accounts with customerId FK AccountDB-->>AccountService: Account saved with ID AccountService-->>CircuitBreaker: AccountResponse CircuitBreaker-->>AccountServiceClient: Success/Fallback AccountServiceClient-->>DataSeeder: List AccountResponse DataSeeder->>DataSeeder: delayElement(10ms) - Rate limiting end DataSeeder-->>APIGateway: customersProcessed: X, accountsGenerated: Y end APIGateway-->>Client: Accounts created for existing customers only end %% Operation 3: Full Dataset Generation rect rgb(255, 200, 200) Note over Client, DataFaker: Scenario 3: Full Dataset Generation Client->>APIGateway: POST /seed/full-dataset?customerCount=1000&minAccountsPerCustomer=1&maxAccountsPerCustomer=4 APIGateway->>DataSeeder: Route to DATA-SEEDER-SERVICE %% Step 1: Generate customers first DataSeeder->>DataSeeder: generateCustomers(1000) Note over DataSeeder, CustomerService: (Same process as Scenario 1) DataSeeder->>DataSeeder: Extract customerIds from created customers %% Step 2: Generate accounts for the newly created customers DataSeeder->>DataSeeder: generateAccountsForCustomers(customerIds, 1, 4) loop For each new customer ID DataSeeder->>DataFaker: Generate 1-4 accounts per customer DataFaker-->>DataSeeder: AccountRequest objects with customerId end loop Batch Processing DataSeeder->>AccountServiceClient: createAccountsBatch List AccountRequest AccountServiceClient->>AccountService: POST /account AccountService->>AccountDB: INSERT accounts with FK to customers AccountDB-->>AccountService: Success AccountService-->>DataSeeder: AccountResponse objects end DataSeeder-->>APIGateway: Complete dataset metrics APIGateway-->>Client: Full dataset created end %% Data Export Operations rect rgb(255, 255, 200) Note over Client, AccountDB: Data Export Operations Client->>APIGateway: GET /seed/export/jmeter-data.csv APIGateway->>DataSeeder: Route request %% Fetch existing data for export par Parallel Data Fetching DataSeeder->>CustomerServiceClient: getAllCustomers() CustomerServiceClient->>CustomerService: GET /customer CustomerService->>CustomerDB: SELECT * FROM customers CustomerDB-->>CustomerService: All customers CustomerService-->>DataSeeder: List CustomerResponse and DataSeeder->>AccountServiceClient: getAllAccounts() AccountServiceClient->>AccountService: GET /account AccountService->>AccountDB: SELECT * FROM accounts AccountDB-->>AccountService: All accounts AccountService-->>DataSeeder: List AccountResponse end DataSeeder->>DataSeeder: Join customer and account data DataSeeder->>DataSeeder: Generate CSV with customer-account relationships DataSeeder-->>APIGateway: CSV file content APIGateway-->>Client: Download jmeter_testdata.csv end %% Key Constraints and Validations Note over DataSeeder: Key Business Rules:
✓ Accounts ONLY created for existing customers
✓ Unique email constraint (usedEmails Set)
✓ Unique account numbers (usedAccountNumbers Set)
✓ Circuit breaker protection on all service calls
✓ Retry with exponential backoff (3 attempts, 1s delay)
✓ Rate limiting with 10ms delays
✓ Batch processing (100 customers, 100 accounts per batch)

Infrastructure Resilience & Performance Patterns

Circuit Breaker Pattern

Resilience4j implementation with separate breakers for Customer and Account services, preventing cascade failures in our data generation pipeline.

Retry with Backoff

Exponential backoff retry (3 attempts, 1-second intervals) integrated with our WebClient calls for transient failure recovery.

Configurable Rate Limiting

10ms request delays and batch processing (100 records) to prevent overwhelming target services during large data generation operations.

Reactive Streams

Flux.range() for data generation, Flux.buffer() for batching, and Mono responses for non-blocking high-throughput operations.

Batch Processing

Configurable batch sizes with delayElement() for rate limiting, processing thousands of records efficiently without memory issues.

Health Monitoring

Built-in health endpoints (/seed/health) and statistics tracking (/seed/stats) with real-time generation metrics and timestamps.

Development Setup

Prerequisites

  • Java 17+ JDK
  • Maven 3.6+
  • MySQL 8.0+
  • Git
  • Docker (optional for containerized deployment)

Clone and Build

# Clone the repository
git clone https://github.com/PritiAryal/MicroBank360.git
cd MicroBank360

# Build all services
mvn clean package

Database Setup

Create databases and configure connection strings:

# For Customer Service
CREATE DATABASE microbank_customer;

# For Account Service
CREATE DATABASE microbank_account;

# For Eureka Server (if using persistence)
CREATE DATABASE microbank_eureka;

Configure application.yml in each service:

spring:
  datasource:
    url: jdbc:mysql://localhost:3306/microbank_customer
    username: dbuser
    password: dbpassword
    driver-class-name: com.mysql.cj.jdbc.Driver
  jpa:
    hibernate:
      ddl-auto: update
    show-sql: true

Run Services

Start services in the following order:

# 1. Eureka Server
cd eureka-server
mvn spring-boot:run

# 2. Customer Service
cd customer-service
mvn spring-boot:run

# 3. Account Service
cd account-service
mvn spring-boot:run

# 4. API Gateway
cd api-gateway
mvn spring-boot:run

# 5. Data Seeder Service
cd dataSeederService
mvn spring-boot:run

Verify services are registered in Eureka dashboard at http://localhost:8761

Generate Test Data

Use the Data Seeder Service to populate the system with test data:

# Generate 500 customers
POST http://localhost:8088/seed/customers/500

# Generate accounts for customers (1-2 accounts per customer)
POST http://localhost:8088/seed/accounts?minAccountsPerCustomer=1&maxAccountsPerCustomer=2

# Generate full dataset in one call
POST http://localhost:8088/seed/full-dataset?customerCount=250&minAccountsPerCustomer=1&maxAccountsPerCustomer=2

# Export data for JMeter
GET http://localhost:8088/seed/export/jmeter-data.csv

Test Endpoints

Use Postman or curl to test the API endpoints through the gateway (default port 8080):

# Create a customer
curl -X POST http://localhost:8080/customer \
  -H "Content-Type: application/json" \
  -d '{"name": "John Doe", "email": "john@example.com", "phone": "+1234567890"}'

# Create an account
curl -X POST http://localhost:8080/account \
  -H "Content-Type: application/json" \
  -d '{"accountNumber": "ACC123456", "accountType": "SAVINGS", "balance": 1000, "customerId": 1}'

# Get customer with accounts
curl http://localhost:8080/customer/1

Architecture Features

Architecture Patterns
  • Microservices Architecture
  • Service Discovery Pattern
  • API Gateway Pattern
  • Database per main Services
  • Client-Side Load Balancing
  • Circuit Breaker Pattern
Technology Stack
  • Java 17+ & Spring Boot
  • Spring Data JPA
  • Spring Cloud Netflix Eureka
  • Spring Cloud Gateway
  • OpenFeign for Inter-service Communication
  • WebFlux for Reactive Programming
  • MySQL Database
  • Circuit Breaker
Communication Flow
  • Client → API Gateway (HTTP/REST)
  • Gateway → Eureka Server (Service Discovery)
  • Gateway → Target Microservice (Load Balanced)
  • Customer Service ↔ Account Service (OpenFeign)
  • Data Seeder → Services (WebClient)
  • Services → MySQL Database (JPA/Hibernate)
Scalability Features
  • Horizontal Service Scaling
  • Dynamic Service Registration
  • Load Balancing
  • Independent Service Deployment
  • Future: Configuration Management
Data Management
  • Dedicated Data Seeder Service
  • DataFaker Integration for Realistic Data
  • Batch Processing Capabilities
  • CSV Export for Performance Testing
  • Circuit Breaker for Fault Tolerance

JMeter Performance and Load Testing Suite

MicroBank360 includes a comprehensive JMeter Performance and Load Testing Suite with automated performance and load testing capabilities, multiple scenarios, and professional reporting.

Testing Architecture

flowchart TD subgraph Test_Scripts["JMeter Test Scripts"] MAIN[microbank360-performance-test.jmx] QUICK[quick-microbank360-test.sh] COMP[run-microbank360-tests.sh] FOOL[foolproof-test.jmx] end subgraph Test_Data["Test Data Sources"] CSV_CUST[customers.csv] CSV_ACC[accounts.csv] CSV_COMBINED[jmeter_testdata.csv] end subgraph Data_Generation["Data Generation Flow"] DS[Data Seeder Service :8088] EXPORT[CSV Export Endpoints] end subgraph Target_Services["Target System"] GW[API Gateway: 8085] CUST[Customer Service] ACC[Account Service] end subgraph Test_Results["Test Results"] JTL[working-results.jtl] HTML[HTML Reports] LOG[jmeter.log] end MAIN --> Test_Data QUICK --> MAIN COMP --> MAIN DS --> EXPORT EXPORT --> CSV_COMBINED Test_Data --> Target_Services Target_Services --> Test_Results

Test Scripts Available

JMeter test plans with configurable parameters and shell script automation.

Test Components:

  • microbank360-performance-test.jmx - Main configurable test plan
  • foolproof-test.jmx - Simple validation test (5 users, 10 loops)
  • quick-microbank360-test.sh - Quick performance validation script
  • run-microbank360-tests.sh - Comprehensive test suite automation

Test Data Integration

CSV-driven testing with realistic data exported from the Data Seeder Service.

Data Files:

  • customers.csv - 31 customer records with realistic profiles
  • accounts.csv - 41 account records with various types
  • jmeter_testdata.csv - Combined customer-account data
  • • Generated from Data Seeder Service export endpoints

Test Scenarios

Baseline Test

  • Users: 10 concurrent
  • Duration: 180 seconds (3 minutes)
  • Ramp-up: 30 seconds
  • Expected TPS: ~5
  • Purpose: Baseline performance validation

Load Test

  • Users: 25 concurrent
  • Duration: 300 seconds (5 minutes)
  • Ramp-up: 60 seconds
  • Expected TPS: ~15
  • Purpose: Normal production load simulation

Stress Test

  • Users: 100 concurrent
  • Duration: 300 seconds (5 minutes)
  • Ramp-up: 90 seconds
  • Expected TPS: ~50
  • Purpose: High load stress testing

Spike Test

  • Users: 200 concurrent
  • Duration: 120 seconds (2 minutes)
  • Ramp-up: 20 seconds
  • Expected TPS: ~100
  • Purpose: Sudden traffic spike simulation

Test Execution

Quick Performance Test

# Default: 10 users, 120 seconds
./quick-microbank360-test.sh

# Custom: 5 users, 60 seconds
./quick-microbank360-test.sh 5 60

# Custom with different server
./quick-microbank360-test.sh 20 300 staging.com

Comprehensive Test Suite

# Run all test scenarios
./run-microbank360-tests.sh

# Run specific test scenario
./run-microbank360-tests.sh baseline
./run-microbank360-tests.sh load
./run-microbank360-tests.sh stress
./run-microbank360-tests.sh spike

# Custom server configuration
./run-microbank360-tests.sh load localhost 8084

Results and Reports

The JMeter tests generate comprehensive results for analysis:

  • working-results.jtl - Raw test results in JTL format
  • jmeter.log - Detailed execution logs
  • HTML Reports - Generated performance dashboards
  • Automated Analysis - Pass/fail criteria with grading (A-F)
# Sample Results from working-results.jtl
timeStamp,elapsed,label,responseCode,responseMessage,threadName
1752999113372,180,Health Check,200,OK,Simple Test Group 1-1
1752999115229,578,Customer 1,200,OK,Simple Test Group 1-2
1752999117858,72,Account 1,200,OK,Simple Test Group 1-1