Skip to content

feat: Java anti-fraud transaction validation system#606

Open
ChristopherEspejo wants to merge 1 commit intoyaperos:mainfrom
ChristopherEspejo:feature/java-anti-fraud-microservices
Open

feat: Java anti-fraud transaction validation system#606
ChristopherEspejo wants to merge 1 commit intoyaperos:mainfrom
ChristopherEspejo:feature/java-anti-fraud-microservices

Conversation

@ChristopherEspejo
Copy link

Summary

  • Implemented two Java Spring Boot microservices with hexagonal architecture communicating via Apache Kafka
  • transaction-service: REST API (POST/GET /transactions) with PostgreSQL, Redis caching (TTL-based), and Kafka event publishing
  • antifraud-service: Kafka consumer that evaluates fraud rules (value > 1000 = rejected) with idempotency pattern

Tech Stack

  • Java 17, Spring Boot 3.2.5
  • Apache Kafka (async inter-service communication)
  • PostgreSQL (separate DB per service)
  • Redis (cache with differentiated TTL: 30s PENDING, 10min APPROVED/REJECTED)
  • Docker multi-stage builds
  • Testcontainers (integration tests)

Architecture

  • Hexagonal Architecture with ports & adapters pattern
  • Event-driven communication (no direct HTTP between services)
  • Manual Kafka offset commit for reliability
  • Idempotency in antifraud-service via evaluated_transactions table

…ring Boot

Two microservices with hexagonal architecture communicating via Kafka:

- transaction-service: REST API for creating/querying transactions with
  PostgreSQL persistence, Redis caching (TTL-based), and Kafka event publishing
- antifraud-service: Kafka consumer that evaluates fraud rules (value > 1000
  = rejected), with idempotency via evaluated_transactions table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant