diff --git a/authentication/authentication-otp-service/src/main/java/io/mosip/authentication/otp/service/controller/OTPController.java b/authentication/authentication-otp-service/src/main/java/io/mosip/authentication/otp/service/controller/OTPController.java index 9590b9a616e..79ad01cf973 100644 --- a/authentication/authentication-otp-service/src/main/java/io/mosip/authentication/otp/service/controller/OTPController.java +++ b/authentication/authentication-otp-service/src/main/java/io/mosip/authentication/otp/service/controller/OTPController.java @@ -178,6 +178,7 @@ public OtpResponseDTO generateOTP(@Valid @RequestBody OtpRequestDTO otpRequestDt throw authTransactionHelper.createDataValidationException(authTxnBuilder, e, requestWithMetadata); } catch (IdAuthenticationBusinessException e) { logger.error(IdAuthCommonConstants.SESSION_ID, e.getClass().toString(), e.getErrorCode(), e.getErrorText()); + if (isEventingEnabled) { if (IdAuthenticationErrorConstants.ID_NOT_AVAILABLE.getErrorCode().equals(e.getErrorCode())) { authenticationErrorEventingPublisher.notify(otpRequestDto, request.getHeader("signature"), diff --git a/authentication/authentication-service/src/main/java/io/mosip/authentication/service/controller/AuthController.java b/authentication/authentication-service/src/main/java/io/mosip/authentication/service/controller/AuthController.java index 035a1767993..9558c2b3b41 100644 --- a/authentication/authentication-service/src/main/java/io/mosip/authentication/service/controller/AuthController.java +++ b/authentication/authentication-service/src/main/java/io/mosip/authentication/service/controller/AuthController.java @@ -179,6 +179,7 @@ public AuthResponseDTO authenticateIndividual(@Validated @RequestBody AuthReques } catch (IdAuthenticationBusinessException e) { mosipLogger.error(IdAuthCommonConstants.SESSION_ID, this.getClass().getSimpleName(), "authenticateApplication", e.getErrorCode() + " : " + e.getErrorText()); + if (isEventingEnabled) { if (IdAuthenticationErrorConstants.ID_NOT_AVAILABLE.getErrorCode().equals(e.getErrorCode())) { authenticationErrorEventingPublisher.notify(authrequestdto, request.getHeader("signature"), diff --git a/authentication/authentication-service/src/main/java/io/mosip/authentication/service/kyc/controller/KycAuthController.java b/authentication/authentication-service/src/main/java/io/mosip/authentication/service/kyc/controller/KycAuthController.java index e655bb9e2f9..9028c16a55d 100644 --- a/authentication/authentication-service/src/main/java/io/mosip/authentication/service/kyc/controller/KycAuthController.java +++ b/authentication/authentication-service/src/main/java/io/mosip/authentication/service/kyc/controller/KycAuthController.java @@ -215,6 +215,7 @@ public EKycAuthResponseDTO processKyc(@Validated @RequestBody EkycAuthRequestDTO } catch (IdAuthenticationBusinessException e) { mosipLogger.error(IdAuthCommonConstants.SESSION_ID, this.getClass().getSimpleName(), "processEKyc", e.getErrorTexts().isEmpty() ? "" : e.getErrorText()); + if (isEventingEnabled) { if (IdAuthenticationErrorConstants.ID_NOT_AVAILABLE.getErrorCode().equals(e.getErrorCode())) { authenticationErrorEventingPublisher.notify(ekycAuthRequestDTO, request.getHeader("signature"), @@ -298,6 +299,7 @@ public KycAuthResponseDTO processKycAuth(@Validated @RequestBody KycAuthRequestD } catch (IdAuthenticationBusinessException e) { mosipLogger.error(IdAuthCommonConstants.SESSION_ID, this.getClass().getSimpleName(), "processKycAuth", e.getErrorTexts().isEmpty() ? "" : e.getErrorText()); + if (isEventingEnabled) { if (IdAuthenticationErrorConstants.ID_NOT_AVAILABLE.getErrorCode().equals(e.getErrorCode())) { authenticationErrorEventingPublisher.notify(authRequestDTO, request.getHeader("signature"),