diff --git a/caf-boot-starters/caf-boot-starter-tenancy/src/main/java/io/iec/edp/caf/tenancy/config/TenantAutoConfiguration.java b/caf-boot-starters/caf-boot-starter-tenancy/src/main/java/io/iec/edp/caf/tenancy/config/TenantAutoConfiguration.java index cf08f27db906581adb5eb71f74b4c555789130ad..a74498f9938b9e94359cd9535088149df8fd37cc 100644 --- a/caf-boot-starters/caf-boot-starter-tenancy/src/main/java/io/iec/edp/caf/tenancy/config/TenantAutoConfiguration.java +++ b/caf-boot-starters/caf-boot-starter-tenancy/src/main/java/io/iec/edp/caf/tenancy/config/TenantAutoConfiguration.java @@ -29,6 +29,7 @@ import io.iec.edp.caf.tenancy.core.extensions.TenantDataSourceIdentifierResolver import io.iec.edp.caf.tenancy.core.properties.MultiTenantProperties; import io.iec.edp.caf.tenancy.core.repository.*; import io.iec.edp.caf.tenancy.core.service.*; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.domain.EntityScan; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.ApplicationEventPublisher; @@ -102,6 +103,7 @@ public class TenantAutoConfiguration { return new TenantManager(repository, tenantCache); } + @ConditionalOnMissingBean(ITenantService.class) @Bean public ITenantService tenantService(MultiTenantProperties properties, TenantManager tenantmgr, DbMappingManager dbMappingMgr, DbConnectionManager dbMgr, TenantAppInstanceMgr appInstMgr, ClusterManager clusterMgr) {