Reactive Mysql access using X DevApi and Spring Reactor
This repository provides an example of using MySQL Connector/J adapted to Reactor Flux
. The X DevAPI
seems to be appropriate
to implement reactive streams compatible api for db interaction.
Following snippet shows builder-like query transformed to Flux
.
The full example with data setup and tests can be found here.
usersTable.select("name")
.where("name IS NOT NULL")
.orderBy("name")
.toFlux()
.map { it.getString("name") }
To use X Protocol
for database quering you should install X plugin
For instructions refer to documentation
You can also use docker-compose.yml
provided.
Just open /scrips
folder of current repository and start docker from command line.
docker-compose up