diff --git a/cassandra-utils/pom.xml b/cassandra-utils/pom.xml index 2b4a3cf5..9e51beaa 100644 --- a/cassandra-utils/pom.xml +++ b/cassandra-utils/pom.xml @@ -77,6 +77,11 @@ sb-utils ${project.version} + + org.sunbird + platform-cache + ${project.version} + diff --git a/cassandra-utils/src/main/java/org/sunbird/helper/CassandraConnectionManagerImpl.java b/cassandra-utils/src/main/java/org/sunbird/helper/CassandraConnectionManagerImpl.java index f3e9ba5a..97e9fda1 100644 --- a/cassandra-utils/src/main/java/org/sunbird/helper/CassandraConnectionManagerImpl.java +++ b/cassandra-utils/src/main/java/org/sunbird/helper/CassandraConnectionManagerImpl.java @@ -16,6 +16,7 @@ import org.sunbird.common.message.IResponseMessage; import org.sunbird.common.message.ResponseCode; import org.sunbird.util.helper.PropertiesCache; +import org.sunbird.cache.util.Platform; public class CassandraConnectionManagerImpl implements CassandraConnectionManager { private static Cluster cluster; @@ -45,30 +46,31 @@ public Session getSession(String keyspace) { private void createCassandraConnection(String[] hosts) throws BaseException { try { - PropertiesCache cache = PropertiesCache.getInstance(); + /*PropertiesCache cache = PropertiesCache.getInstance();*/ + //PropertiesCache cache = PropertiesCache.getInstance(); PoolingOptions poolingOptions = new PoolingOptions(); poolingOptions.setCoreConnectionsPerHost( HostDistance.LOCAL, - Integer.parseInt(cache.getProperty(Constants.CORE_CONNECTIONS_PER_HOST_FOR_LOCAL))); + Platform.getInteger(Constants.CORE_CONNECTIONS_PER_HOST_FOR_LOCAL, 0)); poolingOptions.setMaxConnectionsPerHost( HostDistance.LOCAL, - Integer.parseInt(cache.getProperty(Constants.MAX_CONNECTIONS_PER_HOST_FOR_LOCAl))); + Platform.getInteger(Constants.CORE_CONNECTIONS_PER_HOST_FOR_LOCAL, 0)); poolingOptions.setCoreConnectionsPerHost( HostDistance.REMOTE, - Integer.parseInt(cache.getProperty(Constants.CORE_CONNECTIONS_PER_HOST_FOR_REMOTE))); + Platform.getInteger(Constants.MAX_CONNECTIONS_PER_HOST_FOR_REMOTE, 0)); poolingOptions.setMaxConnectionsPerHost( HostDistance.REMOTE, - Integer.parseInt(cache.getProperty(Constants.MAX_CONNECTIONS_PER_HOST_FOR_REMOTE))); + Platform.getInteger(Constants.MAX_CONNECTIONS_PER_HOST_FOR_REMOTE, 0)); poolingOptions.setMaxRequestsPerConnection( HostDistance.LOCAL, - Integer.parseInt(cache.getProperty(Constants.MAX_REQUEST_PER_CONNECTION))); + Platform.getInteger(Constants.MAX_REQUEST_PER_CONNECTION, 0)); poolingOptions.setHeartbeatIntervalSeconds( - Integer.parseInt(cache.getProperty(Constants.HEARTBEAT_INTERVAL))); + Platform.getInteger(Constants.HEARTBEAT_INTERVAL, 0)); poolingOptions.setPoolTimeoutMillis( - Integer.parseInt(cache.getProperty(Constants.POOL_TIMEOUT))); + Platform.getInteger(Constants.POOL_TIMEOUT, 0)); //check for multi DC enabled or not from configuration file and send the value - cluster = createCluster(hosts, poolingOptions, Boolean.parseBoolean(cache.getProperty(Constants.IS_MULTI_DC_ENABLED))); + cluster = createCluster(hosts, poolingOptions, Platform.config.getBoolean(Constants.IS_MULTI_DC_ENABLED)); final Metadata metadata = cluster.getMetadata(); String msg = String.format("Connected to cluster: %s", metadata.getClusterName()); @@ -82,7 +84,7 @@ private void createCassandraConnection(String[] hosts) throws BaseException { logger.info(msg); } } catch (Exception e) { - logger.info("Error occured while creating cassandra connection :", e); + logger.error("Error occured while creating cassandra connection :", e); throw new BaseException( IResponseMessage.INTERNAL_ERROR, e.getMessage(), ResponseCode.SERVER_ERROR.getCode()); } @@ -162,7 +164,7 @@ public void run() { cluster.close(); logger.info("completed resource cleanup Cassandra."); } catch (Exception ex) { - logger.info("Error :", ex); + logger.error("Error :", ex); } } } diff --git a/cassandra-utils/src/main/resources/cassandra.config.properties b/cassandra-utils/src/main/resources/cassandra.config.properties index d6641ac8..e69de29b 100644 --- a/cassandra-utils/src/main/resources/cassandra.config.properties +++ b/cassandra-utils/src/main/resources/cassandra.config.properties @@ -1,14 +0,0 @@ -coreConnectionsPerHostForLocal=4 -coreConnectionsPerHostForRemote=2 -maxConnectionsPerHostForLocal=10 -maxConnectionsPerHostForRemote=4 -maxRequestsPerConnection=32768 -heartbeatIntervalSeconds=60 -poolTimeoutMillis=0 -contactPoint=127.0.0.1 -port=9042 -userName=cassandra -password=password -queryLoggerConstantThreshold=300 -keyspace=sunbird -isMultiDCEnabled=true \ No newline at end of file diff --git a/group-actors/src/main/java/org/sunbird/actors/CreateGroupActor.java b/group-actors/src/main/java/org/sunbird/actors/CreateGroupActor.java index 51d93460..31c02f83 100644 --- a/group-actors/src/main/java/org/sunbird/actors/CreateGroupActor.java +++ b/group-actors/src/main/java/org/sunbird/actors/CreateGroupActor.java @@ -9,6 +9,7 @@ import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.sunbird.actor.core.ActorConfig; +import org.sunbird.cache.util.Platform; import org.sunbird.common.exception.AuthorizationException; import org.sunbird.common.exception.BaseException; import org.sunbird.common.message.ResponseCode; @@ -92,8 +93,8 @@ private void createGroup(Request actorMessage) throws BaseException { if (CollectionUtils.isNotEmpty(memberList)) { logger.info(actorMessage.getContext(), MessageFormat.format("Adding members to the group: {0} started", groupId)); boolean isUseridRedisEnabled = - Boolean.parseBoolean( - PropertiesCache.getInstance().getConfigValue(JsonKey.ENABLE_USERID_REDIS_CACHE)); + Platform.config.getBoolean(JsonKey.ENABLE_USERID_REDIS_CACHE); + logger.info(actorMessage.getContext(),"createGroup ENABLE_USERID_REDIS_CACHE value: "+ isUseridRedisEnabled); if (isUseridRedisEnabled) { // Remove group list user cache from redis cacheUtil.deleteCacheSync(userId,actorMessage.getContext()); diff --git a/group-actors/src/main/java/org/sunbird/actors/DeleteGroupActor.java b/group-actors/src/main/java/org/sunbird/actors/DeleteGroupActor.java index 54240716..af894692 100644 --- a/group-actors/src/main/java/org/sunbird/actors/DeleteGroupActor.java +++ b/group-actors/src/main/java/org/sunbird/actors/DeleteGroupActor.java @@ -6,6 +6,7 @@ import java.util.Map; import org.apache.commons.lang3.StringUtils; import org.sunbird.actor.core.ActorConfig; +import org.sunbird.cache.util.Platform; import org.sunbird.common.exception.AuthorizationException; import org.sunbird.common.exception.BaseException; import org.sunbird.common.message.ResponseCode; @@ -20,7 +21,6 @@ import org.sunbird.service.MemberServiceImpl; import org.sunbird.util.*; import org.sunbird.common.util.JsonKey; -import org.sunbird.util.helper.PropertiesCache; @ActorConfig( tasks = {"deleteGroup"}, @@ -76,8 +76,8 @@ private void deleteGroup(Request actorMessage) throws BaseException { Response response = groupService.deleteGroup(groupId, membersInDB, actorMessage.getContext()); // delete cache for the group and all members belong to the group boolean isUseridRedisEnabled = - Boolean.parseBoolean( - PropertiesCache.getInstance().getConfigValue(JsonKey.ENABLE_USERID_REDIS_CACHE)); + Platform.config.getBoolean(JsonKey.ENABLE_USERID_REDIS_CACHE); + logger.info(actorMessage.getContext(),"deleteGroup ENABLE_USERID_REDIS_CACHE value: "+ isUseridRedisEnabled); if (isUseridRedisEnabled) { cacheUtil.deleteCacheSync(groupId, actorMessage.getContext()); cacheUtil.delCache(groupId + "_" + JsonKey.MEMBERS); diff --git a/group-actors/src/main/java/org/sunbird/actors/SearchGroupActor.java b/group-actors/src/main/java/org/sunbird/actors/SearchGroupActor.java index eddbe35f..9e5ab418 100644 --- a/group-actors/src/main/java/org/sunbird/actors/SearchGroupActor.java +++ b/group-actors/src/main/java/org/sunbird/actors/SearchGroupActor.java @@ -10,6 +10,7 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.sunbird.actor.core.ActorConfig; +import org.sunbird.cache.util.Platform; import org.sunbird.common.exception.BaseException; import org.sunbird.common.message.ResponseCode; import org.sunbird.models.GroupResponse; @@ -52,9 +53,7 @@ public void onReceive(Request request) throws Throwable { * @param request */ private void searchGroup(Request request) throws BaseException { - boolean isUseridRedisEnabled = - Boolean.parseBoolean( - PropertiesCache.getInstance().getConfigValue(JsonKey.ENABLE_USERID_REDIS_CACHE)); + CacheUtil cacheUtil = new CacheUtil(); GroupService groupService = new GroupServiceImpl(); Map searchQueryMap = request.getRequest(); @@ -66,6 +65,9 @@ private void searchGroup(Request request) throws BaseException { try { if (StringUtils.isNotBlank(userId)) { boolean getFromDB = true; + boolean isUseridRedisEnabled = + Platform.config.getBoolean(JsonKey.ENABLE_USERID_REDIS_CACHE); + logger.info(request.getContext(),"searchGroup ENABLE_USERID_REDIS_CACHE value: "+ isUseridRedisEnabled); if (isUseridRedisEnabled) { String groupList = cacheUtil.getCache(userId,request.getContext()); if (StringUtils.isNotEmpty(groupList)) { diff --git a/group-actors/src/main/java/org/sunbird/actors/UpdateGroupActor.java b/group-actors/src/main/java/org/sunbird/actors/UpdateGroupActor.java index f736cf8b..20d34e45 100644 --- a/group-actors/src/main/java/org/sunbird/actors/UpdateGroupActor.java +++ b/group-actors/src/main/java/org/sunbird/actors/UpdateGroupActor.java @@ -9,6 +9,7 @@ import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.sunbird.actor.core.ActorConfig; +import org.sunbird.cache.util.Platform; import org.sunbird.common.exception.AuthorizationException; import org.sunbird.common.exception.BaseException; import org.sunbird.common.exception.ValidationException; @@ -25,7 +26,6 @@ import org.sunbird.service.MemberServiceImpl; import org.sunbird.util.*; import org.sunbird.common.util.JsonKey; -import org.sunbird.util.helper.PropertiesCache; @ActorConfig( tasks = {"updateGroup"}, @@ -136,10 +136,9 @@ private void updateGroup(Request actorMessage) throws BaseException { } } - boolean isUseridRedisEnabled = - Boolean.parseBoolean( - PropertiesCache.getInstance().getConfigValue(JsonKey.ENABLE_USERID_REDIS_CACHE)); + Platform.config.getBoolean(JsonKey.ENABLE_USERID_REDIS_CACHE); + logger.info(actorMessage.getContext(),"updateGroup ENABLE_USERID_REDIS_CACHE value: "+ isUseridRedisEnabled); if (isUseridRedisEnabled) { cacheUtil.deleteCacheSync(userId,actorMessage.getContext()); // Remove group list user cache from redis diff --git a/group-actors/src/main/java/org/sunbird/actors/UpdateGroupMembershipActor.java b/group-actors/src/main/java/org/sunbird/actors/UpdateGroupMembershipActor.java index 94515460..4841f7b1 100644 --- a/group-actors/src/main/java/org/sunbird/actors/UpdateGroupMembershipActor.java +++ b/group-actors/src/main/java/org/sunbird/actors/UpdateGroupMembershipActor.java @@ -9,6 +9,7 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.sunbird.actor.core.ActorConfig; +import org.sunbird.cache.util.Platform; import org.sunbird.common.exception.AuthorizationException; import org.sunbird.common.exception.BaseException; import org.sunbird.common.exception.ValidationException; @@ -20,7 +21,6 @@ import org.sunbird.service.MemberServiceImpl; import org.sunbird.util.*; import org.sunbird.common.util.JsonKey; -import org.sunbird.util.helper.PropertiesCache; @ActorConfig( tasks = {"updateGroupMembership"}, @@ -68,8 +68,8 @@ private void updateGroupMembership(Request actorMessage) { response = memberService.editMembers(members,actorMessage.getContext(), userId); } boolean isUseridRedisEnabled = - Boolean.parseBoolean( - PropertiesCache.getInstance().getConfigValue(JsonKey.ENABLE_USERID_REDIS_CACHE)); + Platform.config.getBoolean(JsonKey.ENABLE_USERID_REDIS_CACHE); + logger.info(actorMessage.getContext(),"updateGroupMembership ENABLE_USERID_REDIS_CACHE value: "+ isUseridRedisEnabled); if (isUseridRedisEnabled) { // Remove updated groups from cache groups.forEach( diff --git a/group-actors/src/main/resources/cassandra.config.properties b/group-actors/src/main/resources/cassandra.config.properties index e2fdff87..8b137891 100644 --- a/group-actors/src/main/resources/cassandra.config.properties +++ b/group-actors/src/main/resources/cassandra.config.properties @@ -1,13 +1 @@ -coreConnectionsPerHostForLocal=4 -coreConnectionsPerHostForRemote=2 -maxConnectionsPerHostForLocal=10 -maxConnectionsPerHostForRemote=4 -maxRequestsPerConnection=32768 -heartbeatIntervalSeconds=60 -poolTimeoutMillis=0 -contactPoint=127.0.0.1 -port=9042 -userName=cassandra -password=password -queryLoggerConstantThreshold=300 -keyspace=sunbird \ No newline at end of file + diff --git a/group-actors/src/main/resources/dbconfig.properties b/group-actors/src/main/resources/dbconfig.properties index a89505eb..e69de29b 100644 --- a/group-actors/src/main/resources/dbconfig.properties +++ b/group-actors/src/main/resources/dbconfig.properties @@ -1,5 +0,0 @@ -db.ip=127.0.0.1 -db.port=9042 -db.username=cassandra -db.password=password -db.keyspace=sunbird \ No newline at end of file diff --git a/group-actors/src/test/java/org/sunbird/actors/EmbeddedCassandra.java b/group-actors/src/test/java/org/sunbird/actors/EmbeddedCassandra.java index b878b079..c607d071 100644 --- a/group-actors/src/test/java/org/sunbird/actors/EmbeddedCassandra.java +++ b/group-actors/src/test/java/org/sunbird/actors/EmbeddedCassandra.java @@ -10,12 +10,13 @@ import org.cassandraunit.dataset.cql.ClassPathCQLDataSet; import org.cassandraunit.dataset.cql.FileCQLDataSet; import org.cassandraunit.utils.EmbeddedCassandraServerHelper; +import org.sunbird.cache.util.Platform; import org.sunbird.common.util.JsonKey; import org.sunbird.util.ProjectUtil; public class EmbeddedCassandra { - static final String KEYSPACE = ProjectUtil.getConfigValue(JsonKey.SUNBIRD_GROUPS_KEYSPACE); + static final String KEYSPACE = Platform.getString(JsonKey.SUNBIRD_GROUPS_KEYSPACE, ""); static final String GROUP_TABLE = "group"; static final String MEMBER_TABLE = "group_member"; static final String USER_GROUP = "user_group"; diff --git a/group-actors/src/test/resources/application.conf b/group-actors/src/test/resources/application.conf new file mode 100644 index 00000000..090f9921 --- /dev/null +++ b/group-actors/src/test/resources/application.conf @@ -0,0 +1,2 @@ +#Release-5.4.0 - LR-512 +sunbird_groups_keyspace=sunbird_groups \ No newline at end of file diff --git a/sb-utils/pom.xml b/sb-utils/pom.xml index fec5f8d8..88df7921 100644 --- a/sb-utils/pom.xml +++ b/sb-utils/pom.xml @@ -108,6 +108,12 @@ + + org.sunbird + platform-cache + 1.0.0 + test + diff --git a/sb-utils/src/main/resources/cassandra.config.properties b/sb-utils/src/main/resources/cassandra.config.properties index d6641ac8..e69de29b 100644 --- a/sb-utils/src/main/resources/cassandra.config.properties +++ b/sb-utils/src/main/resources/cassandra.config.properties @@ -1,14 +0,0 @@ -coreConnectionsPerHostForLocal=4 -coreConnectionsPerHostForRemote=2 -maxConnectionsPerHostForLocal=10 -maxConnectionsPerHostForRemote=4 -maxRequestsPerConnection=32768 -heartbeatIntervalSeconds=60 -poolTimeoutMillis=0 -contactPoint=127.0.0.1 -port=9042 -userName=cassandra -password=password -queryLoggerConstantThreshold=300 -keyspace=sunbird -isMultiDCEnabled=true \ No newline at end of file diff --git a/sb-utils/src/main/resources/dbconfig.properties b/sb-utils/src/main/resources/dbconfig.properties index a89505eb..e69de29b 100644 --- a/sb-utils/src/main/resources/dbconfig.properties +++ b/sb-utils/src/main/resources/dbconfig.properties @@ -1,5 +0,0 @@ -db.ip=127.0.0.1 -db.port=9042 -db.username=cassandra -db.password=password -db.keyspace=sunbird \ No newline at end of file diff --git a/sb-utils/src/main/resources/externalresource.properties b/sb-utils/src/main/resources/externalresource.properties index 6133d390..e69de29b 100644 --- a/sb-utils/src/main/resources/externalresource.properties +++ b/sb-utils/src/main/resources/externalresource.properties @@ -1,26 +0,0 @@ -sunbird_sso_client_id= -sunbird_sso_username= -sunbird_sso_password= -sunbird_sso_url= -sunbird_sso_realm= -LEARNER_SERVICE_PORT= -sunbird_user_service_search_url=/private/api/user/v1/search -CONTENT_SERVICE_PORT= -sunbird_cs_search_url= -sunbird_authorization= -sunbird_health_check_enable=true -sunbird_us_system_setting_url=/api/data/v1/system/settings/list -sunbird_us_org_read_url=/v1/org/read -enable_userid_redis_cache=true -groups_redis_ttl=86400 -user_redis_ttl=3600 -max_group_members_limit =150 -max_activity_limit=20 -max_group_limit=50 -max_batch_limit=2 -notification_service_base_url= -notification_service_api_url=/v2/notification/send -enable_tenant_config=custchannel,tc - -#Release-5.4.0 - LR-512 -sunbird_groups_keyspace=sunbird_groups \ No newline at end of file diff --git a/sb-utils/src/main/resources/sso.properties b/sb-utils/src/main/resources/sso.properties index ce3a6507..e69de29b 100644 --- a/sb-utils/src/main/resources/sso.properties +++ b/sb-utils/src/main/resources/sso.properties @@ -1,4 +0,0 @@ -sso.url= -sso.realm=sunbird -sso.connection.pool.size=20 -sso.enabled=true diff --git a/sb-utils/src/main/resources/telemetry.config.properties b/sb-utils/src/main/resources/telemetry.config.properties index 8b76e5ba..e69de29b 100644 --- a/sb-utils/src/main/resources/telemetry.config.properties +++ b/sb-utils/src/main/resources/telemetry.config.properties @@ -1,4 +0,0 @@ -telemetry_pdata_id=dev.sunbird.groups.service -telemetry_pdata_pid=groups-service -telemetry_pdata_ver=8.0.0 - diff --git a/sb-utils/src/test/java/org/sunbird/util/ProjectUtilTest.java b/sb-utils/src/test/java/org/sunbird/util/ProjectUtilTest.java index 6d49b1d7..aff046e8 100644 --- a/sb-utils/src/test/java/org/sunbird/util/ProjectUtilTest.java +++ b/sb-utils/src/test/java/org/sunbird/util/ProjectUtilTest.java @@ -3,19 +3,20 @@ import static org.junit.Assert.*; import org.junit.Test; +import org.sunbird.cache.util.Platform; import org.sunbird.common.util.JsonKey; public class ProjectUtilTest { @Test public void testGetConfigValueWithExistsInPropertyFile() { - String exists = ProjectUtil.getConfigValue(JsonKey.SUNBIRD_HEALTH_CHECK_ENABLE); + String exists = String.valueOf(Platform.config.getBoolean(JsonKey.SUNBIRD_HEALTH_CHECK_ENABLE)); assertEquals("true", exists); } @Test public void testGetConfigValueWithNotExistsInPropertyFile() { - String exists = ProjectUtil.getConfigValue("sunbird_health_check_not_enable"); - assertNull(exists); + Boolean exists = Platform.config.getBoolean("sunbird_health_check_not_enable"); + assertFalse(exists); } } diff --git a/sb-utils/src/test/resources/application.conf b/sb-utils/src/test/resources/application.conf new file mode 100644 index 00000000..9d26bf62 --- /dev/null +++ b/sb-utils/src/test/resources/application.conf @@ -0,0 +1,26 @@ +sunbird_sso_client_id="" +sunbird_sso_username="" +sunbird_sso_password="" +sunbird_sso_url="" +sunbird_sso_realm="" +LEARNER_SERVICE_PORT="" +sunbird_user_service_search_url=/private/api/user/v1/search +CONTENT_SERVICE_PORT="" +sunbird_cs_search_url="" +sunbird_authorization="" +sunbird_health_check_enable=true +sunbird_us_system_setting_url=/api/data/v1/system/settings/list +sunbird_us_org_read_url=/v1/org/read +enable_userid_redis_cache=true +groups_redis_ttl=86400 +user_redis_ttl=3600 +max_group_members_limit =150 +max_activity_limit=20 +max_group_limit=50 +max_batch_limit=2 +notification_service_base_url="" +notification_service_api_url=/v2/notification/send +enable_tenant_config=["custchannel","tc"] + +#Release-5.4.0 - LR-512 +sunbird_groups_keyspace=sunbird_groups \ No newline at end of file diff --git a/service/app/utils/ApplicationStart.java b/service/app/utils/ApplicationStart.java index b40084b0..52d31e63 100644 --- a/service/app/utils/ApplicationStart.java +++ b/service/app/utils/ApplicationStart.java @@ -5,8 +5,11 @@ import javax.inject.Singleton; import org.sunbird.Application; import org.sunbird.auth.verifier.KeyManager; +import org.sunbird.cache.util.Platform; import org.sunbird.common.exception.BaseException; +import org.sunbird.telemetry.TelemetryEnvKey; import org.sunbird.util.*; +import org.sunbird.util.helper.PropertiesCache; import play.api.Environment; import play.api.inject.ApplicationLifecycle; @@ -16,6 +19,8 @@ */ @Singleton public class ApplicationStart { + + LoggerUtil logger = new LoggerUtil(ApplicationStart.class); /** * All one time initialization which required during server startup will fall here. * @@ -37,6 +42,14 @@ public ApplicationStart(ApplicationLifecycle lifecycle, Environment environment) return CompletableFuture.completedFuture(null); }); KeyManager.init(); + logger.info("sunbird_user_service_search_url:1 "+ System.getenv("sunbird_user_service_search_url")); + logger.info("sunbird_user_service_search_url:2 "+ PropertiesCache.getInstance().getProperty("sunbird_user_service_search_url")); + logger.info("sunbird_user_service_search_url:3 "+ Platform.getString("sunbird_user_service_search_url", "")); + logger.info("sunbird_health_check_enable:1 "+ PropertiesCache.getInstance().getProperty("sunbird_health_check_enable")); + logger.info("sunbird_health_check_enable:2 "+ Platform.getBoolean("sunbird_health_check_enable", false)); + logger.info("user_redis_ttl:1 "+ PropertiesCache.getInstance().getProperty("user_redis_ttl")); + logger.info("user_redis_ttl:2 "+ Platform.getLong("user_redis_ttl", 0l)); + logger.info("groupid: "+ TelemetryEnvKey.GROUPID); } private void setEnvironment(Environment environment) { diff --git a/service/app/utils/module/OnRequestHandler.java b/service/app/utils/module/OnRequestHandler.java index c9a3b1d6..64100858 100644 --- a/service/app/utils/module/OnRequestHandler.java +++ b/service/app/utils/module/OnRequestHandler.java @@ -11,6 +11,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.MDC; +import org.sunbird.cache.util.Platform; import org.sunbird.common.exception.AuthorizationException; import org.sunbird.common.exception.BaseException; import org.sunbird.common.message.IResponseMessage; @@ -207,11 +208,11 @@ private String getCustodianOrgHashTagId() { private static Map cacheTelemetryPdata() { Map telemetryPdata = new HashMap<>(); - telemetryPdata.put("telemetry_pdata_id", PropertiesCache.getConfigValue("telemetry_pdata_id")); + telemetryPdata.put("telemetry_pdata_id", Platform.getString("telemetry_pdata_id", "")); telemetryPdata.put( - "telemetry_pdata_pid", PropertiesCache.getConfigValue("telemetry_pdata_pid")); + "telemetry_pdata_pid", Platform.getString("telemetry_pdata_pid", "")); telemetryPdata.put( - "telemetry_pdata_ver", PropertiesCache.getConfigValue("telemetry_pdata_ver")); + "telemetry_pdata_ver", Platform.getString("telemetry_pdata_ver", "")); return telemetryPdata; } diff --git a/service/conf/application.conf b/service/conf/application.conf index 9b076975..a5814fcf 100755 --- a/service/conf/application.conf +++ b/service/conf/application.conf @@ -307,6 +307,54 @@ redis.maxConnections=${?sunbird_redis_max_connections} #Release 5.4.0 LR-512 redis.dbIndex=${?sunbird_redis_db_index} +sunbird_sso_client_id="" +sunbird_sso_username="" +sunbird_sso_password="" +sunbird_sso_url="" +sunbird_sso_realm="" +LEARNER_SERVICE_PORT="" +sunbird_user_service_search_url=/private/api/user/v1/search +CONTENT_SERVICE_PORT="" +sunbird_cs_search_url="" +sunbird_authorization="" +sunbird_health_check_enable=true +sunbird_us_system_setting_url=/api/data/v1/system/settings/list +sunbird_us_org_read_url=/v1/org/read +enable_userid_redis_cache=true +groups_redis_ttl=86400 +user_redis_ttl=3600 +max_group_members_limit =150 +max_activity_limit=20 +max_group_limit=50 +max_batch_limit=2 +notification_service_base_url="" +notification_service_api_url=/v2/notification/send +enable_tenant_config=["custchannel","tc"] + +#Release-5.4.0 - LR-512 +sunbird_groups_keyspace=sunbird_groups + +#telemetry.config.properties +telemetry_pdata_id=dev.sunbird.groups.service +telemetry_pdata_pid=groups-service +telemetry_pdata_ver=8.0.0 + +#cassandra.config.properties +coreConnectionsPerHostForLocal=4 +coreConnectionsPerHostForRemote=2 +maxConnectionsPerHostForLocal=10 +maxConnectionsPerHostForRemote=4 +maxRequestsPerConnection=32768 +heartbeatIntervalSeconds=60 +poolTimeoutMillis=0 +contactPoint=127.0.0.1 +port=9042 +userName=cassandra +password=password +queryLoggerConstantThreshold=300 +keyspace=sunbird +isMultiDCEnabled = true + ## WS (HTTP Client) # ~~~~~ diff --git a/service/pom.xml b/service/pom.xml index aba439e3..dcbd3b5c 100755 --- a/service/pom.xml +++ b/service/pom.xml @@ -96,6 +96,11 @@ config 1.3.0 + + org.sunbird + platform-cache + ${project.version} + com.github.danielwegener logback-kafka-appender