Spring Boot multiple datasources
An example of Spring Boot, written in Kotlin, demonstrates how to use Hibernate with Kotlin as well as multiple datasources with the ability of creating tables of the datasources. And support for transaction in multiple datasources.
To understand more about the project read the following tutorials,
How to run
First need to start the databases (MySQL 8 and PostgreSQL 12) with docker-compose
,
$ docker-compose up -d
Then run the project using mvnw
,
$ ./mvnw spring-boot:run -Dserver.port=8090
Lastly, open the browser and type localhost:8090/swagger-ui.html
.
You should see the Swagger interface to interact with the API.
Tips
To change the database configurations modify docker-compose.yml
and if necessary application.properties
.