Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Latest commit

 

History

History
24 lines (20 loc) · 985 Bytes

README.md

File metadata and controls

24 lines (20 loc) · 985 Bytes

Spring MultiDB example

This is an example implementation for Spring MultiDB solution

Installation

There is a Maven wrapper pushed to the repository so you can run the project with that file (mvnw or mvnw.cmd). All you need is to set up two local (Postgre) databases described in the application.yml file

spring:
  datasource:
    view:
      type: com.zaxxer.hikari.HikariDataSource
      url: jdbc:postgresql://stanlin.wanari.com:5432/spring-multidb-view
      username: spring-multidb-view
      password: spring-multidb-view
    prod:
      type: com.zaxxer.hikari.HikariDataSource
      url: jdbc:postgresql://stanlin.wanari.com:5432/spring-multidb-prod
      username: spring-multidb-prod
      password: spring-multidb-prod

Liquibase will insert the initial data for you when the application starts.

You can try it out for example with Postman by calling the API