From 7421a56a2cf52c82ab1301332861e1ceab02ce15 Mon Sep 17 00:00:00 2001 From: dhanendra06 <60607841+dhanendra06@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:20:08 +0530 Subject: [PATCH] Added logger (#1341) Signed-off-by: dhanendra06 --- .../impl/idevent/IdChangeEventHandlerServiceImpl.java | 3 +++ .../websub/impl/RemoveIdStatusEventPublisher.java | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/authentication/authentication-common/src/main/java/io/mosip/authentication/common/service/impl/idevent/IdChangeEventHandlerServiceImpl.java b/authentication/authentication-common/src/main/java/io/mosip/authentication/common/service/impl/idevent/IdChangeEventHandlerServiceImpl.java index 4c7a6c58dbb..e01d665ba73 100644 --- a/authentication/authentication-common/src/main/java/io/mosip/authentication/common/service/impl/idevent/IdChangeEventHandlerServiceImpl.java +++ b/authentication/authentication-common/src/main/java/io/mosip/authentication/common/service/impl/idevent/IdChangeEventHandlerServiceImpl.java @@ -185,10 +185,13 @@ private void handleCredentialIssued(EventModel eventModel) throws IdAuthenticati private void handleRemoveId(EventModel eventModel) throws IdAuthenticationBusinessException { Event event = eventModel.getEvent(); + Map additionalData = event.getData(); String idHash = (String) additionalData.get(ID_HASH); + mosipLogger.info(">>>>>handleRemoveId event received, idHash value: {}",idHash); if (idHash != null && !idHash.isEmpty() && identityCacheRepo.existsById(idHash)) { identityCacheRepo.deleteById(idHash); + mosipLogger.info(">>>>> deleted idHash value: {}",idHash); removeIdStatusEventPublisher.publishRemoveIdStatusEvent(idHash); } } diff --git a/authentication/authentication-common/src/main/java/io/mosip/authentication/common/service/websub/impl/RemoveIdStatusEventPublisher.java b/authentication/authentication-common/src/main/java/io/mosip/authentication/common/service/websub/impl/RemoveIdStatusEventPublisher.java index 48e7c2ab1ed..03abdb5be2b 100644 --- a/authentication/authentication-common/src/main/java/io/mosip/authentication/common/service/websub/impl/RemoveIdStatusEventPublisher.java +++ b/authentication/authentication-common/src/main/java/io/mosip/authentication/common/service/websub/impl/RemoveIdStatusEventPublisher.java @@ -70,8 +70,14 @@ protected void doRegister() { public void publishRemoveIdStatusEvent(String idHash) { RemoveIdStatusEvent removeIdStatusEvent = createRemoveIdStatusEvent(idHash); - webSubHelper.publishEvent(removeIdStatusTopic, - webSubHelper.createEventModel(removeIdStatusTopic, removeIdStatusEvent)); + logger.info(">>>>>>> removeIdStatusEvent :{}",removeIdStatusEvent); + try { + webSubHelper.publishEvent(removeIdStatusTopic, + webSubHelper.createEventModel(removeIdStatusTopic, removeIdStatusEvent)); + }catch (Exception e){ + logger.error("removeIdStatus publish Event Error :{}",e.getMessage()); + } + } /**