multidatasource-multitenancy
Demonstrates a scenario where a single Spring Boot application connects to multiple databases and also implements multi-tenant logic (schema-based or DB-based).
Application Flow
How It Works
Multiple DataSources: Oracle for certain domain objects, Postgres for others.
MultiTenancy: Switches which schema or DB to use based on an incoming tenant identifier.
TenantInterceptor: Captures request-scope tenant info and sets it in the
TenantIdentifierResolver
.
Run tests
./mvnw clean verify
Run locally
Useful Links
Swagger UI: http://localhost:8080/swagger-ui.html
Actuator Endpoint: http://localhost:8080/actuator
PgAdmin : http://localhost:5050
Previousmultitenancy-dbNextPartitioned (Discriminator) Data – the data for each tenant is partitioned by a discriminator value
Last updated