diff --git a/core/platform-common/src/main/resources/externalresource.properties b/core/platform-common/src/main/resources/externalresource.properties index 93e10c5f77..eb4fd087be 100644 --- a/core/platform-common/src/main/resources/externalresource.properties +++ b/core/platform-common/src/main/resources/externalresource.properties @@ -115,4 +115,5 @@ user_read_api_v2_non_mandatory_fields= profileDetails.verifiedKarmayogi,profileD profileDetails.employmentDetails.pinCode,profileDetails.personalDetails.telephone,profileDetails.professionalDetails[0].industry,\ profileDetails.professionalDetails[0].designation,profileDetails.professionalDetails[0].location,\ profileDetails.professionalDetails[0].doj,profileDetails.professionalDetails[0].description,profileDetails.employmentDetails.departmentName +kafka_user_first_login_event_topic= dev.user.first.login diff --git a/service/src/main/java/org/sunbird/service/user/UserProfileReadService.java b/service/src/main/java/org/sunbird/service/user/UserProfileReadService.java index e0c9ccde4a..aede0a8aee 100644 --- a/service/src/main/java/org/sunbird/service/user/UserProfileReadService.java +++ b/service/src/main/java/org/sunbird/service/user/UserProfileReadService.java @@ -743,18 +743,19 @@ public Response getUserLoggedInDetails(Request actorMessage) throws Exception { Map map1 = new HashMap<>(); map1.putIfAbsent(JsonKey.ID, userId); Response response = cassandraOperation.getRecordsByProperties(JsonKey.SUNBIRD, JsonKey.USER, map1, actorMessage.getRequestContext()); - Map trymap = new HashMap<>(); + Map userDetailsMap = new HashMap<>(); List> list = (List>) response.get(JsonKey.RESPONSE); - list.forEach(a -> a.forEach(trymap::putIfAbsent)); + list.forEach(a -> a.forEach(userDetailsMap::putIfAbsent)); Map map = new HashMap<>(); - if (trymap.get("first_login") == null) { + if (userDetailsMap.get("first_login") == null) { map.put(JsonKey.ID, userId); map.put(JsonKey.LAST_LOGIN, new Timestamp(Calendar.getInstance().getTime().getTime())); map.put(JsonKey.FIRST_LOGIN, new Timestamp(Calendar.getInstance().getTime().getTime())); cassandraOperation.upsertRecord(JsonKey.SUNBIRD, JsonKey.USER, map, actorMessage.getRequestContext()); Map data = new HashMap<>(); data.put(JsonKey.EDATA, map); - InstructionEventGenerator.pushInstructionEvent("user_first_login_topic", data); + String topic =ProjectUtil.getConfigValue("kafka_user_first_login_event_topic"); + InstructionEventGenerator.pushInstructionEvent(topic, data); } else { map.put(JsonKey.ID, userId); map.put(JsonKey.LAST_LOGIN, new Timestamp(Calendar.getInstance().getTime().getTime()));