Online Event Processing Platform
1- Download Tools https://quarkus.io/get-started/
- VSCode from https://code.visualstudio.com/Download
- JDK from https://adoptopenjdk.net/ ( Download for macOS x64 - Version OpenJDK 8 JVM - Open J9 )
- Maven from https://maven.apache.org/
- Kafka from https://kafka.apache.org/downloads
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}
- 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
- Download Code & Run
$ cd $HOME
$ git clone https://github.com/afuentes/realtimebusiness.git
$ cd realtimebusiness/kafka-quickstart
$ mvn compile quarkus:dev
- Verified the example is Running
open your browser to http://localhost:8080/prices.html, and you should see a fluctuating price.
- 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));
}
- 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
- Comming Soon ...