mvn clean packagedocker-compose upImportant topics
- Usage of an
Emitterto send a message to Kafka - Kafka configuration (`application.properties)
- Usage of JSON-B to map
Payment toString`
cd payment-service
mvn compile quarkus:devListening on port 8081.
Send payments with:
http :8081/payment account=1111 amount:=10
http :8081/payment account=1112 amount:=520
http :8081/payment account=1113 amount:=50
http :8081/payment account=1111 amount:=45
http :8081/payment account=1112 amount:=22
http :8081/payment account=1113 amount:=345
http :8081/payment account=1111 amount:=3
http :8081/payment account=1112 amount:=67
http :8081/payment account=1113 amount:=99
http :8081/payment account=1111 amount:=100
http :8081/payment account=1112 amount:=345
http :8081/payment account=1113 amount:=678Optional: Use Kafka Tool to check topic content:
- Connect to localhost
- Navigate to
Clusters -> Topics -> Transactions - Click on data
- Click on the green arrow
Important topics
- From Kafka to Websocket
- Injection of stream (
@Stream)
cd transaction-viewer
mvn compile quarkus:devListening on port 8082
- Open your browser to http://localhost:8082
- By default, it shows the transactions for the account
1111. - Open
me.escoffier.quarkus.reactive.TransactionSocketand change the account to1112. - Save and refresh the browser
- Send another payment:
http :8081/payment account=1112 amount:=1234- It should appear automatically
IMPORTANT: Do not refresh the browser, as the message have been acknowledged, you will only see the new ones.
Important topics
- Processing of stream to to complex stream logic
cd fraud-detector
mvn compile quarkus:devListening on port 8083
- Open your browser to http://localhost:8083
- By default it detects fraud with a threshold set to 5000
- Generate a fraud:
http :8081/payment account=1112 amount:=2234
http :8081/payment account=1112 amount:=200
http :8081/payment account=1112 amount:=300
http :8081/payment account=1112 amount:=2000
http :8081/payment account=1112 amount:=1000- The page should list it immediately
- Edit
me.escoffier.quarkus.reactive.FraudDetectorand extend the threshold - Refresh the page
IMPORTANT: Do not refresh the browser, as the message have been acknowledged, you will only see the new ones.