From f154a2d6f12d22b08d0bdf585c10c2050ade1019 Mon Sep 17 00:00:00 2001 From: Sowmya Ujjappa Banakar Date: Fri, 15 Dec 2023 14:52:48 +0530 Subject: [PATCH 1/2] MOSIP-30470 code fix after testing Signed-off-by: Sowmya Ujjappa Banakar --- .../uingenerator/stage/UinGeneratorStage.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/registration-processor/core-processor/registration-processor-uin-generator-stage/src/main/java/io/mosip/registration/processor/stages/uingenerator/stage/UinGeneratorStage.java b/registration-processor/core-processor/registration-processor-uin-generator-stage/src/main/java/io/mosip/registration/processor/stages/uingenerator/stage/UinGeneratorStage.java index 73e2dc70242..37ccce8e732 100644 --- a/registration-processor/core-processor/registration-processor-uin-generator-stage/src/main/java/io/mosip/registration/processor/stages/uingenerator/stage/UinGeneratorStage.java +++ b/registration-processor/core-processor/registration-processor-uin-generator-stage/src/main/java/io/mosip/registration/processor/stages/uingenerator/stage/UinGeneratorStage.java @@ -278,12 +278,21 @@ public MessageDTO process(MessageDTO object) { demographicIdentity.put("UIN", uinField); idResponseDTO = sendIdRepoWithUin(registrationId, registrationStatusDto.getRegistrationType(), demographicIdentity, uinField, description); - if(idResponseDTO.getErrors()!=null && idResponseDTO.getErrors().get(0).getErrorCode().equalsIgnoreCase(INVALID_INPUT_PARAMETER_ERROR_CODE)) { + if ((idResponseDTO.getErrors() != null && !idResponseDTO.getErrors().isEmpty()) && idResponseDTO + .getErrors().get(0).getErrorCode().equalsIgnoreCase(INVALID_INPUT_PARAMETER_ERROR_CODE)) { for (int i = 0; i < maxRetrycount; i++) { regProcLogger.info(StatusUtil.INVALID_INPUT_PARAMETER.getMessage()+":"+StatusUtil.INVALID_INPUT_PARAMETER.getCode()+", Retrying "+(i+1)+" times"); - idResponseDTO = sendIdRepoWithUin(registrationId, registrationStatusDto.getRegistrationType(), demographicIdentity, + // This log will remove later after testing why iteration is not happening in + // server before this fix + regProcLogger.info(LoggerFileConstant.SESSIONID.toString(), + LoggerFileConstant.REGISTRATIONID.toString(), registrationId, + idResponseDTO.toString()); + idResponseDTO = sendIdRepoWithUin(registrationId, + registrationStatusDto.getRegistrationType(), demographicIdentity, uinField, description); - if (idResponseDTO.getErrors()==null || idResponseDTO.getErrors().get(0).getErrorCode()!=INVALID_INPUT_PARAMETER_ERROR_CODE) + if ((idResponseDTO.getErrors() == null || idResponseDTO.getErrors().isEmpty()) + || idResponseDTO.getErrors().get(0) + .getErrorCode() != INVALID_INPUT_PARAMETER_ERROR_CODE) break; } From 2058df9194e4bac290699d5903a1813fcfd692ac Mon Sep 17 00:00:00 2001 From: Sowmya Ujjappa Banakar Date: Fri, 15 Dec 2023 15:44:03 +0530 Subject: [PATCH 2/2] MOSIP-30470 code fix after testing Signed-off-by: Sowmya Ujjappa Banakar --- .../stages/uingenerator/stage/UinGeneratorStage.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/registration-processor/core-processor/registration-processor-uin-generator-stage/src/main/java/io/mosip/registration/processor/stages/uingenerator/stage/UinGeneratorStage.java b/registration-processor/core-processor/registration-processor-uin-generator-stage/src/main/java/io/mosip/registration/processor/stages/uingenerator/stage/UinGeneratorStage.java index 37ccce8e732..a14470e0a58 100644 --- a/registration-processor/core-processor/registration-processor-uin-generator-stage/src/main/java/io/mosip/registration/processor/stages/uingenerator/stage/UinGeneratorStage.java +++ b/registration-processor/core-processor/registration-processor-uin-generator-stage/src/main/java/io/mosip/registration/processor/stages/uingenerator/stage/UinGeneratorStage.java @@ -278,7 +278,7 @@ public MessageDTO process(MessageDTO object) { demographicIdentity.put("UIN", uinField); idResponseDTO = sendIdRepoWithUin(registrationId, registrationStatusDto.getRegistrationType(), demographicIdentity, uinField, description); - if ((idResponseDTO.getErrors() != null && !idResponseDTO.getErrors().isEmpty()) && idResponseDTO + if (idResponseDTO.getErrors() != null && !idResponseDTO.getErrors().isEmpty() && idResponseDTO .getErrors().get(0).getErrorCode().equalsIgnoreCase(INVALID_INPUT_PARAMETER_ERROR_CODE)) { for (int i = 0; i < maxRetrycount; i++) { regProcLogger.info(StatusUtil.INVALID_INPUT_PARAMETER.getMessage()+":"+StatusUtil.INVALID_INPUT_PARAMETER.getCode()+", Retrying "+(i+1)+" times"); @@ -290,7 +290,7 @@ public MessageDTO process(MessageDTO object) { idResponseDTO = sendIdRepoWithUin(registrationId, registrationStatusDto.getRegistrationType(), demographicIdentity, uinField, description); - if ((idResponseDTO.getErrors() == null || idResponseDTO.getErrors().isEmpty()) + if (idResponseDTO.getErrors() == null || idResponseDTO.getErrors().isEmpty() || idResponseDTO.getErrors().get(0) .getErrorCode() != INVALID_INPUT_PARAMETER_ERROR_CODE) break;