Code Monkey home page Code Monkey logo

padogrid / bundle-jet-3-cluster-trade Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 481 KB

‼️ **Deprecated.** *As of PadoGrid v1.0.0, Jet 3.x and Jet 4.x are no longer supported. This bundle runs only on PadoGrid v0.9.x.* The trade cluster bundle installs a Jet cluster that includes the build_app script to clone and build the realtime-trade-monitor project maintained at the GitHub URL shown below.

License: Apache License 2.0

Shell 100.00%
kafka trade hazelcast-jet javalin blotter aggregate

bundle-jet-3-cluster-trade's Introduction

PadoGrid PadoGrid | Catalogs | Manual | FAQ | Releases | Templates | Pods | Kubernetes | Docker | Apps | Quick Start


Host OS VM Docker Kubernetes

Jet Cluster: trade

‼️ Deprecated. As of PadoGrid v1.0.0, Jet 3.x and Jet 4.x are no longer supported. This bundle runs only on PadoGrid v0.9.x. The trade cluster bundle installs a Jet cluster that includes the build_app script to clone and build the realtime-trade-monitor project maintained at the GitHub URL shown below.

https://github.com/cangencer/realtime-trade-monitor.git

Installing Bundle

install_bundle -download bundle-jet-3-cluster-trade

Use Case

This use case demonstrates Jet aggregating Kafka streamed trade data in real time. It includes a trade blotter UI for monitoring the trade aggregations executed in the Jet cluster.

Jet Trade Diagram

Required Software

You must first install Kafka to run the realtime-trade-monitor app. To follow the steps shown in this document, you need to set the KAFKA_HOME environment variable to the Kafka installation directory. For example,

export KAFKA_HOME=~/Work/products/kafka_2.12-2.3.1
export PATH=$PATH:$KAFKA_HOME/bin

Installing and Building the trade Bundle

To build it, run the build_app script in the trade cluster's bin_sh directory as follows:

# Switch to the trade cluster
switch_cluster trade
cd bin_sh

# Build app
./build_app

Running Cluster

Make sure to add at least one member before starting the cluster.

# Add 2 members
add_member; add_member

# Start cluster
start_cluster

Running Apps

The build_app script clones the realtime-trade-monitor repo in the cluster directory.

switch_cluster trade
cd realtime-trade-monitor

The following lists the commands described in the realtime-trade-monitor repo in the order they should be executed.

# 1. Start Zookeeper and Kafka
zookeeper-server-start.sh $KAFKA_HOME/config/zookeeper.properties 
kafka-server-start.sh $KAFKA_HOME/config/server.properties

# 2. Create the 'trades' topic to which we'll publish trades
kafka-topics.sh --create --replication-factor 1 --partitions 4 --topic trades --zookeeper localhost:2181

# 3. Load stock symbols into the 'symbols' map in Jet
java -jar trade-queries/target/trade-queries-1.0-SNAPSHOT.jar load-symbols

# 4. Ingest (drain) all trade objects in the 'trades' topic in Kafka via Jet
java -jar trade-queries/target/trade-queries-1.0-SNAPSHOT.jar ingest-trades localhost:9092

# 5. Aggregate trades from the 'trades' topic in Kafka via Jet
java -jar trade-queries/target/trade-queries-1.0-SNAPSHOT.jar aggregate-query localhost:9092

# 6. Publish data into the 'trades' topic in Kafka
java -jar trade-producer/target/trade-producer-1.0-SNAPSHOT.jar localhost:9092 10

# 7. Start web server
java -jar webapp/target/webapp-1.0-SNAPSHOT.jar

Trade Blotter URL: http://localhost:9000

Tearing Down

# 1. Ctrl-C servers running in the foreground:
#    Javalin web server (7),  trade-producter (6), Kafka server (1), Zookeeper (1)

# 2. Stop Jet cluster
stop_cluster

Tips

# To clear the 'trade' topic, change the retention perioid to 1 sec
kafka-topics.sh --zookeeper localhost:2181 --alter --topic trades --config retention.ms=1000

# Wait 1+ sec and change back the retention period (5 days)
kafka-topics.sh --zookeeper localhost:2181 --alter --topic trades --config retention.ms=432000000

PadoGrid PadoGrid | Catalogs | Manual | FAQ | Releases | Templates | Pods | Kubernetes | Docker | Apps | Quick Start

bundle-jet-3-cluster-trade's People

Contributors

padogrid avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.