This repository contains my completed solution for the Midas Core component as part of the JPMorgan Chase Software Engineering Virtual Experience on Forage.
The project simulates a production-grade financial processing system that integrates Kafka, Spring Boot, H2 Database, and a REST Incentive API, all designed to mimic a real-world microservices environment.
Midas Core is the central component responsible for:
- Receiving real-time transaction events via Kafka
- Validating and storing financial transactions in a SQL database
- Applying incentives from an external REST API
- Exposing user balances through a REST endpoint
- Forked and cloned the scaffolded repo:
vagabond-systems/forage-midas - Configured the project in IntelliJ with Java 17 and Maven
- Added required dependencies to
pom.xml:spring-boot-starter-data-jpaspring-boot-starter-webspring-kafkah2spring-boot-starter-testspring-kafka-testtestcontainers-kafka
- Verified setup by running
TaskOneTests
- Implemented a Kafka listener that:
- Listens to the topic defined in
application.yml - Deserializes incoming messages to
Transactionobjects
- Listens to the topic defined in
- Verified functionality using in-memory Kafka provided in the test suite
- Ran
TaskTwoTestsand used debugger to inspect message handling
- Created
TransactionRecordentity to persist valid transactions - Implemented validation rules:
- Valid sender and recipient IDs
- Sufficient sender balance
- Updated balances upon successful transaction processing
- Ensured one-to-many relationships between
UserandTransactionRecord - Ran
TaskThreeTestsand verified post-processing balances
- Integrated external API using
RestTemplateto post validated transactions - Received incentive amounts via
/incentiveendpoint - Stored incentives alongside transactions
- Adjusted recipient balances to include incentive amounts
- Ensured incentives were not deducted from sender balances
- Ran
TaskFourTestsand verified updated balances
- Developed a REST controller exposing a
GET /balanceendpoint - Accepts
userIdas a query parameter - Returns JSON response using the provided
Balanceclass - Default response for unknown users: balance of 0
- Exposed service on port 33400
- Confirmed coexistence of Kafka listener and REST controller
- Ran
TaskFiveTestsfor final verification
| Tech | Description |
|---|---|
| Java 17 | Core programming language |
| Spring Boot | Application framework |
| Kafka | Asynchronous message broker |
| H2 | In-memory SQL database |
| REST API | External incentive service integration |
| Maven | Dependency and build management |
| JUnit | Testing framework |
src/
├── main/
│ └── java/
│ └── com/example/midascore/
│ ├── MidasCoreApplication.java
│ ├── config/
│ ├── controller/
│ ├── kafka/
│ ├── model/
│ ├── repository/
│ ├── service/
├── test/
│ └── java/
│ └── ... (TaskOneTests through TaskFiveTests)
- Clone the repo and navigate into it.
- Start the Incentive API (
services/incentive-api.jar) on port8080. - Run the Spring Boot application on port
33400. - Use Postman or your browser to hit:
GET http://localhost:33400/balance?userId=someUser
- This project is based on the JPMorgan Chase Forage Internship
- Educational and non-commercial use only
- Original repo: vagabond-systems/forage-midas