Class MultiTenancyUtils
Multi-tenancy is active as soon as the axoniq-multi-tenancy module is on the classpath, because its
ConfigurationEnhancers are contributed through the
ServiceLoader. disable(ComponentRegistry) is the way to opt out again.
This class lives in the module's base package so that every multi-tenancy ConfigurationEnhancer is a
downward dependency and can be referenced as a class literal.
- Since:
- 5.3.0
- Author:
- Jan Galinski, Jakob Hatzl
-
Method Summary
Modifier and TypeMethodDescriptionstatic voiddisable(ComponentRegistry componentRegistry) Switches multi-tenancy off for the givencomponentRegistry, leaving it to behave as a single-tenant application.
-
Method Details
-
disable
Switches multi-tenancy off for the givencomponentRegistry, leaving it to behave as a single-tenant application.Use this to opt out in an application that carries the
axoniq-multi-tenancymodule transitively but runs single-tenant:MessagingConfigurer.create() .componentRegistry(MultiTenancyUtils::disable);Only takes effect while the multi-tenancy enhancers have not run yet. Applying this directly to a
ComponentRegistryis therefore always safe, as enhancers run at build time. Applying it from within anotherConfigurationEnhancerrequires that enhancer to have a lowerConfigurationEnhancer.order()thanMultiTenancyConfigurationDefaults.ENHANCER_ORDER.- Parameters:
componentRegistry- theComponentRegistryto disable multi-tenancy in
-