kuzds / easy-pay

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Easy-pay

This repository contains a couple of microservices which communicate using Kafka.

Payment-ms

Features:

  • Receive transaction info using endpoint:
POST http://localhost:8080/pay
{
    "accountId": 1000, # ID consultant account
    "amount": 120.20 # Replenishment amount
}
  • Put it in Kafka topic

Technology stack:

  • Spring Boot Starter Web
  • Spring Kafka Producer

Backend-ms

Features:

  • Get transaction from Kafka topic
  • Persist it in MySQL database.
  • Every 2 minutes append new transactions to CSV file in the form:
  id;account_id;amount;datetime_transaction
  1;1000;120.20;2022-07-28 07:00:00

Technology stack:

  • Spring without Boot
  • Slf4j logger
  • Hibernate
  • MySQL database
  • Flyway database migration tool
  • Spring Kafka Consumer
  • Opencsv for writing CSV files

Local development

# Run mySQL database
docker-compose -f docker-compose-mysql.yml -p mysql-easypay up -d
# Run Kafka
docker-compose -f docker-compose-kafka.yml -p kafka-easypay up -d      

About


Languages

Language:Java 100.0%