Quickstart (2 minutes)
Add the runtime modules:
<dependency>
<groupId>io.github.mathias82</groupId>
<artifactId>quarkus-multitenancy-http-runtime</artifactId>
<version>0.1.15</version>
</dependency>
<dependency>
<groupId>io.github.mathias82</groupId>
<artifactId>quarkus-multitenancy-orm-runtime</artifactId>
<version>0.1.15</version>
</dependency>
Configure tenant resolution (Header example):
quarkus.multi-tenant.http.enabled=true
quarkus.multi-tenant.http.strategy=header
quarkus.multi-tenant.http.header-name=X-Tenant
Test:
curl -H "X-Tenant: tenant1" http://localhost:8080/tenant
Quarkus multitenancy: OIDC multitenancy vs tenant resolution
When developers search for Quarkus multitenancy, they often mean OIDC multitenancy (multiple OIDC tenants/providers). This project targets a different gap: resolving the tenant id consistently (header/JWT/cookie) and exposing a TenantContext across the request lifecycle.
Quarkus multitenant: complements Hibernate ORM multitenancy
When developers search for Quarkus multitenant, they often mean database/schema isolation via Hibernate ORM multitenancy. This plugin doesn’t replace it; it provides the missing tenant-resolution contract that feeds ORM routing reliably.
FAQ
Is this the same as OIDC multitenancy? No, OIDC multitenancy focuses on selecting auth/provider configuration. This focuses on tenant id resolution and propagation.
Does this replace Hibernate ORM multitenancy? No, it complements it by providing consistent tenant resolution inputs for routing.
Header vs JWT vs Cookie? Header is great for microservices; JWT claim fits auth-centric flows; cookie works for browser apps. The key is a single shared contract.
Demo
git clone https://github.com/mathias82/quarkus-multitenancy
cd quarkus-multitenancy/quarkus-multitenancy-demo
docker-compose up -d
mvn quarkus:dev
See the demo README and Postman collection in the repo.