From 347c83f21b7418440923cfc84381429c2c29c028 Mon Sep 17 00:00:00 2001 From: SomeshRA Date: Mon, 13 Jan 2025 12:15:10 +0000 Subject: [PATCH 1/3] SSCSSI-443: Remove feature toggle BYPASS_NOTIFICATIONS_SERVICE --- charts/sscs-tribunals-api/values.aat.template.yaml | 1 - .../values.hearings.preview.template.yaml | 1 - .../sscs-tribunals-api/values.preview.template.yaml | 1 - .../sscs/service/servicebus/TopicConsumer.java | 12 ++---------- src/main/resources/config/application.yaml | 4 ---- .../sscs/service/servicebus/TopicConsumerTest.java | 4 ++-- 6 files changed, 4 insertions(+), 19 deletions(-) diff --git a/charts/sscs-tribunals-api/values.aat.template.yaml b/charts/sscs-tribunals-api/values.aat.template.yaml index 12e6d656737..6a8c2f75504 100644 --- a/charts/sscs-tribunals-api/values.aat.template.yaml +++ b/charts/sscs-tribunals-api/values.aat.template.yaml @@ -10,6 +10,5 @@ java: HANDLE_CCD_CALLBACKMAP_V2: true POST_HEARINGS_B_FEATURE: true POST_HEARINGS_FEATURE: true - BYPASS_NOTIFICATIONS_SERVICE: true INFECTED_BLOOD_COMPENSATION_ENABLED: true SUBMIT_APPEAL_SERVICE_V2_ENABLED: true diff --git a/charts/sscs-tribunals-api/values.hearings.preview.template.yaml b/charts/sscs-tribunals-api/values.hearings.preview.template.yaml index 9767ee9d77f..ad0991788eb 100644 --- a/charts/sscs-tribunals-api/values.hearings.preview.template.yaml +++ b/charts/sscs-tribunals-api/values.hearings.preview.template.yaml @@ -41,7 +41,6 @@ java: DELETED_REDACTED_DOC_ENABLED: true CITIZEN_LOGIN_SERVICE_V2: true ADD_LINK_TO_OTHER_ASSOCIATED_CASES_V2: true - BYPASS_NOTIFICATIONS_SERVICE: true HANDLE_CCD_CALLBACKMAP_V2: true TESTING_SUPPORT_ENABLED: true SEND_LETTER_SERVICE_ENABLED: "true" diff --git a/charts/sscs-tribunals-api/values.preview.template.yaml b/charts/sscs-tribunals-api/values.preview.template.yaml index a4730691b3b..4ab69bf77a6 100644 --- a/charts/sscs-tribunals-api/values.preview.template.yaml +++ b/charts/sscs-tribunals-api/values.preview.template.yaml @@ -39,7 +39,6 @@ java: DELETED_REDACTED_DOC_ENABLED: true CITIZEN_LOGIN_SERVICE_V2: true ADD_LINK_TO_OTHER_ASSOCIATED_CASES_V2: true - BYPASS_NOTIFICATIONS_SERVICE: true BYPASS_HEARING_API_SERVICE: true HANDLE_CCD_CALLBACKMAP_V2: true TESTING_SUPPORT_ENABLED: true diff --git a/src/main/java/uk/gov/hmcts/reform/sscs/service/servicebus/TopicConsumer.java b/src/main/java/uk/gov/hmcts/reform/sscs/service/servicebus/TopicConsumer.java index cbc879a2799..08652039aba 100644 --- a/src/main/java/uk/gov/hmcts/reform/sscs/service/servicebus/TopicConsumer.java +++ b/src/main/java/uk/gov/hmcts/reform/sscs/service/servicebus/TopicConsumer.java @@ -28,18 +28,15 @@ public class TopicConsumer { private final CallbackDispatcher dispatcher; private final SscsCaseCallbackDeserializer sscsDeserializer; private final NotificationsMessageProcessor notificationsMessageProcessor; - private final boolean isNotificationServiceBypassed; public TopicConsumer(@Value("${callback.maxRetryAttempts}") Integer maxRetryAttempts, CallbackDispatcher dispatcher, - SscsCaseCallbackDeserializer sscsDeserializer, NotificationsMessageProcessor notificationsMessageProcessor, - @Value("${feature.bypass-notifications-service.enabled:false}") boolean isNotificationServiceBypassed) { + SscsCaseCallbackDeserializer sscsDeserializer, NotificationsMessageProcessor notificationsMessageProcessor) { this.maxRetryAttempts = maxRetryAttempts; //noinspection unchecked this.dispatcher = dispatcher; this.sscsDeserializer = sscsDeserializer; this.notificationsMessageProcessor = notificationsMessageProcessor; - this.isNotificationServiceBypassed = isNotificationServiceBypassed; } @@ -52,12 +49,7 @@ public TopicConsumer(@Value("${callback.maxRetryAttempts}") Integer maxRetryAtte public void onMessage(String message, @Header(JmsHeaders.MESSAGE_ID) String messageId) { log.info("Message Id {} received from the service bus", messageId); processEvidenceShareMessageWithRetry(message, 1, messageId); - - log.info("Determining if notification service should be bypassed {} ", isNotificationServiceBypassed ? "Yes" : "No"); - if (isNotificationServiceBypassed) { - log.info("Bypassing notification service for message id {}", messageId); - notificationsMessageProcessor.processMessage(message, messageId); - } + notificationsMessageProcessor.processMessage(message, messageId); } private void processEvidenceShareMessageWithRetry(String message, int retry, String messageId) { diff --git a/src/main/resources/config/application.yaml b/src/main/resources/config/application.yaml index 1d638801b1c..f78d77c5530 100644 --- a/src/main/resources/config/application.yaml +++ b/src/main/resources/config/application.yaml @@ -283,8 +283,6 @@ feature: enabled: ${SCOTTISH_PO_BOX_ENABLED:false} urgent-hearing: enabled: ${URGENT_HEARING_ENABLED:false} - bypass-notifications-service: - enabled: ${BYPASS_NOTIFICATIONS_SERVICE:false} handle-ccd-callbackMap-v2: enabled: ${HANDLE_CCD_CALLBACKMAP_V2:false} submit-appeal-service-v2: @@ -2033,14 +2031,12 @@ spring: accept-case-insensitive-enums: true accept-case-insensitive-properties: true job.scheduler: - autoStart: ${BYPASS_NOTIFICATIONS_SERVICE:false} retryPolicy: maxNumberOfJobExecutions: 2 delayBetweenAttemptsInMs: 1000 quartzProperties: org.quartz: scheduler: - autoStartup: ${BYPASS_NOTIFICATIONS_SERVICE:false} instanceId: AUTO idleWaitTime: ${JOB_SCHEDULER_POLL_INTERVAL:10000} dataSource: diff --git a/src/test/java/uk/gov/hmcts/reform/sscs/service/servicebus/TopicConsumerTest.java b/src/test/java/uk/gov/hmcts/reform/sscs/service/servicebus/TopicConsumerTest.java index 243696ec652..75dc47aa074 100644 --- a/src/test/java/uk/gov/hmcts/reform/sscs/service/servicebus/TopicConsumerTest.java +++ b/src/test/java/uk/gov/hmcts/reform/sscs/service/servicebus/TopicConsumerTest.java @@ -42,7 +42,7 @@ public class TopicConsumerTest { @Before public void setup() { - topicConsumer = new TopicConsumer(RETRY_THREE_TIMES, dispatcher, deserializer, notificationsMessageProcessor, false); + topicConsumer = new TopicConsumer(RETRY_THREE_TIMES, dispatcher, deserializer, notificationsMessageProcessor); } @Test @@ -134,7 +134,7 @@ public void handleValidRequest() { @Test public void shouldProcessMessageForNotifications() { - topicConsumer = new TopicConsumer(RETRY_THREE_TIMES, dispatcher, deserializer, notificationsMessageProcessor, true); + topicConsumer = new TopicConsumer(RETRY_THREE_TIMES, dispatcher, deserializer, notificationsMessageProcessor); topicConsumer.onMessage(MESSAGE, "1"); verify(notificationsMessageProcessor).processMessage(MESSAGE, "1"); } From 476fecb256a1788a1dc25dd374fbf4a43ace789e Mon Sep 17 00:00:00 2001 From: SomeshRA <69344273+SomeshRA@users.noreply.github.com> Date: Wed, 22 Jan 2025 14:09:38 +0000 Subject: [PATCH 2/3] Update values.preview.template.yaml --- charts/sscs-tribunals-api/values.preview.template.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/charts/sscs-tribunals-api/values.preview.template.yaml b/charts/sscs-tribunals-api/values.preview.template.yaml index 2928caa50cb..b83af0a4926 100644 --- a/charts/sscs-tribunals-api/values.preview.template.yaml +++ b/charts/sscs-tribunals-api/values.preview.template.yaml @@ -37,7 +37,6 @@ java: ELASTIC_SEARCH_FEATURE: true ELINKS_V2_FEATURE_ENABLED: true DELETED_REDACTED_DOC_ENABLED: true - BYPASS_HEARING_API_SERVICE: true TESTING_SUPPORT_ENABLED: true EXUI_API_URL: "https://${SERVICE_NAME}-xui" TOPIC_NAME: "${SERVICE_NAME}-servicebus-main-topic" From 71cf57c495979f0304f17e7da0203db012c378a6 Mon Sep 17 00:00:00 2001 From: SomeshRA <69344273+SomeshRA@users.noreply.github.com> Date: Wed, 22 Jan 2025 14:12:36 +0000 Subject: [PATCH 3/3] Update application.yaml --- src/main/resources/config/application.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main/resources/config/application.yaml b/src/main/resources/config/application.yaml index cd056b89111..366bf0abd3d 100644 --- a/src/main/resources/config/application.yaml +++ b/src/main/resources/config/application.yaml @@ -279,10 +279,6 @@ feature: enabled: ${SCOTTISH_PO_BOX_ENABLED:false} urgent-hearing: enabled: ${URGENT_HEARING_ENABLED:false} - process-event-message-v2: - enabled: ${PROCESS_EVENT_MESSAGE_V2_ENABLED:false} - bypass-hearing-api-service: - enabled: ${BYPASS_HEARING_API_SERVICE:false} hearings-case-updateV2: enabled: ${HEARINGS_CASE_UPDATE_V2_ENABLED:false}