Projects for Spring One Platform 2019
This repo contains 3 Spring Boot projects
-
update-currency - A REST application for updating currency conversion rates: It uses Spring JPA and will auto-create the schema for the
currency
table; theapplication.properties
are configured to use a database namedcdc
. -
from-maxwell - Receives change events from MySQL via Zendesk Maxwell and a Kafka topic
maxwell
and forwards currency changes to compacted topiccurrency
. Deletions are forwarded as tombstone records. -
read-currency - Receives currency events and stores them in a map for instant use within the application. Java and Kotlin versions are provided.
Install MySQL and Maxwell (I used homebrew on Mac OS).
I had some [authentication issues with MySQL 8, documented here](zendesk/maxwell#1232).
server_id=1
log-bin=master
binlog_format=row
default-authentication-plugin=mysql_native_password
CREATE USER 'maxwell'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS 'maxwell';
Run maxwell
$ maxwell --user maxwell --password maxwell --producer=kafka --kafka.bootstrap.servers=localhost:9092 --kafka_topic=maxwell
Run all three boot applications and post a few currency updates:
$ curl -X POST http://localhost:8080/update/USD/1000
$ curl -X POST http://localhost:8080/update/GBP/782
$ curl -X POST http://localhost:8080/update/EUR/800
$ curl -X POST http://localhost:8080/delete/EUR
Observe the console of the read-currency application.