Skip to content

afuentes/realtimebusiness

Repository files navigation

Real Time Business

Online Event Processing Platform

Prepared Enviroment

1- Download Tools https://quarkus.io/get-started/

2- Install maven + kafka

$ cd $HOME/toolset
$ unzip apache-maven-3.6.2-bin.zip
$ tar xvfz kafka_2.12-2.3.0.tar.gz  

Note : Java was installed using .dmg file

3- Enviroment Profile .bash_profile

# TOOLSET 
export TOOLSET=$HOME/toolset
export JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8-openj9.jdk/Contents/Home/ 
export MAVEN_HOME=${TOOLSET}/apache-maven-3.6.2
export KAFKA_HOME=${TOOLSET}/kafka_2.12-2.3.0
export KAFKA_CONFIG=${TOOLSET}/kafka_2.12-2.3.0/config
export PATH=${JAVA_HOME}/bin:${MAVEN_HOME}/bin:${KAFKA_HOME}/bin:${PATH}
  1. Startup Kafka Cluster
$ zookeeper-server-start.sh $KAFKA_CONFIG/zookeeper.properties
$ kafka-server-start.sh $KAFKA_CONFIG/server.properties

Note: open different terminal for each process

  1. Download Code & Run
$ cd $HOME
$ git clone  https://github.com/afuentes/realtimebusiness.git
$ cd  realtimebusiness/kafka-quickstart
$ mvn compile quarkus:dev
  1. Verified the example is Running

open your browser to http://localhost:8080/prices.html, and you should see a fluctuating price.

  1. Changed de interval from 5 to 2 in PriceGenerator.java
    @Outgoing("generated-price")
    public Flowable<Integer> generate() {
        return Flowable.interval(2, TimeUnit.SECONDS)
                .map(tick -> random.nextInt(100));
    }
  1. Using reload quarkus features update page and validate the new interval

Refresh http://localhost:8080/prices.html, and you should see fluctuating price new interval period

Architecture with Detail of Component

Architecture

  1. Comming Soon ...

Reference

About

Real Time Business Strategic

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published