Commit ffadd2ae authored by harshit aggarwal's avatar harshit aggarwal
Browse files

Conditionally enabling TenantFactory component

parent aa4b1e0d
Pipeline #7862 passed with stages
in 9 minutes and 42 seconds
...@@ -74,11 +74,13 @@ Note: Below are reference PRs for exclusion and might change from service to ser ...@@ -74,11 +74,13 @@ Note: Below are reference PRs for exclusion and might change from service to ser
Refer this [MR](https://community.opengroup.org/osdu/platform/security-and-compliance/entitlements-azure/-/merge_requests/13) as reference on how to exclude dependencies along with how to enable the Refer this [MR](https://community.opengroup.org/osdu/platform/security-and-compliance/entitlements-azure/-/merge_requests/13) as reference on how to exclude dependencies along with how to enable the
Enabled transaction logger and slf4jlogger Enabled transaction logger and slf4jlogger
## Environment variables to be added in application.properties to consume the TenantFactoryImpl ## Environment variables to be added in application.properties to consume the TenantFactoryImpl
| name | value | description | | name | value | description |
| --- | --- | --- | | --- | --- | --- |
| `tenantInfo.container.name` | `TenantInfo` | cosmos container name | | `tenantInfo.container.name` | `TenantInfo` | cosmos container name |
| `azure.cosmosdb.database` | ex `dev-osdu-r2-db` | cosmos database name | | `azure.cosmosdb.database` | ex `dev-osdu-r2-db` | cosmos database name |
| `tenantFactoryImpl.required` | ex `true` | Set this property to true in order to consume TenantFactoryImpl class from core-lib-azure |
## Settings to be added in application.properties to consume the BlobStore ## Settings to be added in application.properties to consume the BlobStore
| name | value | description | | name | value | description |
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<groupId>org.opengroup.osdu</groupId> <groupId>org.opengroup.osdu</groupId>
<artifactId>core-lib-azure</artifactId> <artifactId>core-lib-azure</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>0.0.26</version> <version>0.0.27</version>
<name>core-lib-azure</name> <name>core-lib-azure</name>
<properties> <properties>
......
...@@ -21,6 +21,7 @@ import org.opengroup.osdu.core.common.model.http.DpsHeaders; ...@@ -21,6 +21,7 @@ import org.opengroup.osdu.core.common.model.http.DpsHeaders;
import org.opengroup.osdu.core.common.provider.interfaces.ITenantFactory; import org.opengroup.osdu.core.common.provider.interfaces.ITenantFactory;
import org.opengroup.osdu.core.common.model.tenant.TenantInfo; import org.opengroup.osdu.core.common.model.tenant.TenantInfo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -32,7 +33,7 @@ import java.util.Collection; ...@@ -32,7 +33,7 @@ import java.util.Collection;
* Implementation for ITenantFactory. * Implementation for ITenantFactory.
*/ */
@Component @Component
@Lazy @ConditionalOnProperty(value = "tenantFactoryImpl.required", havingValue = "true", matchIfMissing = false)
public class TenantFactoryImpl implements ITenantFactory { public class TenantFactoryImpl implements ITenantFactory {
@Autowired @Autowired
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment