Skip to content

cangencer/realtime-trade-monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Real-time Trade Monitor

A sample dashboard which uses Hazelcast Jet to ingest trades from Apache Kafka into a distributed map. It also performs an aggregation on the trades, storing the results into a separate map.

These two maps are utilized by a live dashboard which offers drill down functionality into viewing individual trades that make up the aggregation.

How to run:

  1. Build the project
mvn package
  1. Create a topic on the Kafka cluster:
kafka-topics --create --replication-factor 1 --partitions 4 --topic trades --zookeeper localhost:2181
  1. Start the Kafka producer
java -jar trade-producer/target/trade-producer-1.0-SNAPSHOT.jar <bootstrap servers> <trades per sec>
  1. Start the Jet cluster. To configure cluster members you can edit hazelcast.yaml in the jet-server/src/main/resources folder.
java -jar jet-server/target/jet-server-1.0-SNAPSHOT.jar
  1. Run the queries

The cluster connection can be configured inside the hazelcast-client.yaml file.

  • Load static data into map: (Stock names)
java -jar trade-queries/target/trade-queries-1.0-SNAPSHOT.jar load-symbols
  • Ingest trades from Kafka
java -jar trade-queries/target/trade-queries-1.0-SNAPSHOT.jar ingest-trades <bootstrap servers>
  • Aggregate trades by symbol
java -jar trade-queries/target/trade-queries-1.0-SNAPSHOT.jar aggregate-query <bootstrap servers>
  1. Start the front end

The cluster connection can be configured inside the hazelcast-client.yaml file.

java -jar webapp/target/webapp-1.0-SNAPSHOT.jar 

Browse to localhost:9000 to see the dashboard.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published