/spring-boot-multitenant-sample-testswagger-2024

Spring Boot multi-tenant sample app

Primary LanguageJavaApache License 2.0Apache-2.0

Spring Boot multi-tenant sample app

This sample app uses the Spring Boot starter library from Quantics which contains all the configuration options that are required to build a multi-tenant Spring Boot application.

There are two working examples in this repo which can be activated via Spring profiles:

Spring Profile Tenant resolution mode
default Header (using custom HTTP header)
prod JWT (using OAuth2 issuer claim)

The code in this repository accompanies the following blog posts:

test

java -jar target/spring-boot-multitenant-sample-0.1.0.jar

prod

java -jar target/spring-boot-multitenant-sample-0.1.0.jar --spring.profiles.active=prod
  • dukes tenant: Log in with isabelle/password.
  • beans tenant: Log in with bjorn/password.

Unit test

mvn clean test -Dtest="io.jomatt.multitenant.sample.header.MultiTenantHeaderApplicationTests"
mvn clean test -Dtest="io.jomatt.multitenant.sample.jwt.MultiTenantJwtApplicationTests"