AxonFramework / extension-multitenancy

Axon Framework extension providing handles to support multi tenancy with distinct buses and stores per tenant.
Apache License 2.0
10 stars 2 forks source link

Interceptor on tenant registration #216

Closed zistow closed 1 week ago

zistow commented 3 weeks ago

Refers to: https://discuss.axoniq.io/t/multitenancy-datasource-and-hikari-properties/5662/5?u=kaef

smcvb commented 3 weeks ago

@zistow, would you mind expanding the description to contain all the valuable information from the referred to discuss issue? As it is, this ticket is unclear. Thanks for your help!

schananas commented 1 week ago

The way to go is to create a custom component that extends: MultiTenantAwareComponent Inject the Tenant Provider bean and subscribe to your custom component for updates:

tenantProvider.subscribe(multiTenantAwareComponent);

Your component will get called every time there is a new tenant registered through this approach.