Skip to content

Spring example written in Kotlin demonstrates how to use mutiple datasources with the ability of creating tables of the datasources

License

Notifications You must be signed in to change notification settings

kasramp/spring-multiple-datasources

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 to create tables of the datasources and support for distributed transactions in multiple datasources.

To understand more about the project read the following tutorials,

How to run

First, start the databases (MySQL 8 and PostgreSQL 15) 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 http:https://localhost:8080/swagger-ui/index.html. You should see the Swagger interface to interact with the API.

Tips

To change the database configuration modify docker-compose.yml and if necessary application.properties.