Simple stock exchange system
how to up?
- Use any kafka image to up kafka in docker(user default config of broker)
- Go inside each service and up one by one using command (mvn clean install -> mvn spring-boot:run)
- once all 3 services are up use below curl to place individual buy/sell orders.
- Currently queue size for matching orders is 3, it can be increased to the need.
curl --location 'http://localhost:8080/api/kafka/orders'
--header 'Content-Type: application/json'
--data '{ "type": "sell", "price": 101.95, "quantity": 150
}'
curl --location 'http://localhost:8080/api/kafka/orders'
--header 'Content-Type: application/json'
--data '{
"type": "buy",
"price": 100.95,
"quantity": 150
}'
what is left?
- Storing each matched records into database by generating unique orderId for each buy/sell order and storing match against it.
- Storing price/time data in timeseries db as well.
- Send notification to users
- Send current price updates through websocket to users