Note: The easiest way to get started and deploy the application is by signing up for a free trial of Ververica Cloud.
You can also find more details on this video here.
You can find the application here. This project provides multiple Apache Flink streaming jobs to handle various stock market scenarios:
-
MarketEventImpactAnalysis
Evaluates how specific market events impact stock prices in real time. -
PriceSpikeDetection
Detects significant stock price increases within a defined time window using Flink's CEP. -
RapidTradeDetection
Identifies potential rapid or manipulative trading activities by detecting multiple trades from the same trader in quick succession, while also enriching trade data. -
SmartTradeExecution
Dynamically decides whether to execute, delay, or cancel trade orders based on real-time price volatility thresholds.
-
models package
Defines the data model for stock trading, includingMarket Events
,Stocks
,Trade Orders
andTrader
details. -
StockMarketDataGenerator.java
Uses javafaker to create realistic synthetic transaction data with random amounts, currency codes, merchants, and geolocation. -
FxProducer.java
Generates transactions and sends them to a Kafka topic. Make sure to fill in the required properties forbootstrap.servers
andsasl.jaas.config
into theAppConfig.java
file.
Use Maven to build and package the application:
mvn clean package
Run any of the jobs by specifying its main class. For example:
java -cp target/your-jar-file.jar com.ververica.apps.SmartTradeExecution
Replace SmartTradeExecution
with the desired job name.
- Java 11
- Maven
- Apache Flink 1.17