From 7e55b976c56b0cd66d4059be93e86ea2a4906e3e Mon Sep 17 00:00:00 2001 From: brodrigu <8272332+brero12@users.noreply.github.com> Date: Thu, 7 Sep 2023 14:13:08 -0700 Subject: [PATCH 1/3] Adding properties to grow up cache connection size --- .../spd/notification/worker/OutputNotificationConsumer.java | 3 ++- .../src/main/resources/application.properties | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/spd-notification-worker/src/main/java/ca/bc/gov/open/pssg/rsbc/spd/notification/worker/OutputNotificationConsumer.java b/src/spd-notification-worker/src/main/java/ca/bc/gov/open/pssg/rsbc/spd/notification/worker/OutputNotificationConsumer.java index 21270347..f0d49605 100644 --- a/src/spd-notification-worker/src/main/java/ca/bc/gov/open/pssg/rsbc/spd/notification/worker/OutputNotificationConsumer.java +++ b/src/spd-notification-worker/src/main/java/ca/bc/gov/open/pssg/rsbc/spd/notification/worker/OutputNotificationConsumer.java @@ -39,6 +39,7 @@ public class OutputNotificationConsumer { private static final String DPS_FILE_ID_KEY = "dps.fileId"; private static final String DPS_BUSINESS_AREA_CD_KEY = "dps.businessAreaCd"; private static final String DEFAULT_VALUE = "0"; + private static final String CONCURRENCY_QUEUE = "5"; private final FileService fileService; private final SftpProperties sftpProperties; @@ -57,7 +58,7 @@ public OutputNotificationConsumer(FileService fileService, this.kofaxOutputMetadataContext = kofaxOutputMetadataContext; } - @RabbitListener(queues = Keys.CRRP_QUEUE_NAME) + @RabbitListener(queues = Keys.CRRP_QUEUE_NAME, concurrency = CONCURRENCY_QUEUE) public void receiveMessage(OutputNotificationMessage message) { logger.info("received new {}", message); diff --git a/src/spd-notification-worker/src/main/resources/application.properties b/src/spd-notification-worker/src/main/resources/application.properties index b09d798f..c1249bd6 100644 --- a/src/spd-notification-worker/src/main/resources/application.properties +++ b/src/spd-notification-worker/src/main/resources/application.properties @@ -4,6 +4,8 @@ spring.rabbitmq.host=${RABBITMQ_HOST:localhost} spring.rabbitmq.port=${RABBITMQ_PORT:5672} spring.rabbitmq.username=${RABBITMQ_USERNAME:guest} spring.rabbitmq.password=${RABBITMQ_PASSWORD:guest} +spring.rabbitmq.password=${RABBITMQ_PASSWORD:guest} +spring.rabbitmq.cache.connection.size=${RABBITMQ_CACHECONNSIZE:50} dps.messaging.exchange-name=notification dps.messaging.routing-key=CRRP From aa9ef4b87d7863e5702cf0f8954f48805df3a08a Mon Sep 17 00:00:00 2001 From: brodrigu <8272332+brero12@users.noreply.github.com> Date: Thu, 7 Sep 2023 14:17:45 -0700 Subject: [PATCH 2/3] Adding properties to retry simple listener --- .../src/main/resources/application.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/src/spd-notification-worker/src/main/resources/application.properties b/src/spd-notification-worker/src/main/resources/application.properties index c1249bd6..21d33da2 100644 --- a/src/spd-notification-worker/src/main/resources/application.properties +++ b/src/spd-notification-worker/src/main/resources/application.properties @@ -6,6 +6,7 @@ spring.rabbitmq.username=${RABBITMQ_USERNAME:guest} spring.rabbitmq.password=${RABBITMQ_PASSWORD:guest} spring.rabbitmq.password=${RABBITMQ_PASSWORD:guest} spring.rabbitmq.cache.connection.size=${RABBITMQ_CACHECONNSIZE:50} +spring.rabbitmq.listener.simple.retry.enabled=${RABBITMQ_RETRY:true} dps.messaging.exchange-name=notification dps.messaging.routing-key=CRRP From 2311adba50e140cebc3aa8824554e4bf3affd946 Mon Sep 17 00:00:00 2001 From: brodrigu <8272332+brero12@users.noreply.github.com> Date: Sun, 10 Sep 2023 21:01:51 -0700 Subject: [PATCH 3/3] Adding properties to retry 10 times --- .../src/main/resources/application.properties | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/spd-notification-worker/src/main/resources/application.properties b/src/spd-notification-worker/src/main/resources/application.properties index 21d33da2..4f918a37 100644 --- a/src/spd-notification-worker/src/main/resources/application.properties +++ b/src/spd-notification-worker/src/main/resources/application.properties @@ -4,9 +4,14 @@ spring.rabbitmq.host=${RABBITMQ_HOST:localhost} spring.rabbitmq.port=${RABBITMQ_PORT:5672} spring.rabbitmq.username=${RABBITMQ_USERNAME:guest} spring.rabbitmq.password=${RABBITMQ_PASSWORD:guest} -spring.rabbitmq.password=${RABBITMQ_PASSWORD:guest} spring.rabbitmq.cache.connection.size=${RABBITMQ_CACHECONNSIZE:50} spring.rabbitmq.listener.simple.retry.enabled=${RABBITMQ_RETRY:true} +spring.rabbitmq.listener.simple.missing-queues-fatal=false +spring.rabbitmq.listener.simple.retry.initial-interval=5000 // the first time will wait 5 seconds to try again +spring.rabbitmq.listener.simple.retry.max-attempts=10 //will try a maximum of 10 times +spring.rabbitmq.listener.simple.retry.max-interval=300000 // the maximum interval between attempts is 5 minutes +spring.rabbitmq.listener.simple.retry.multiplier=1.0 // multiplies the range by 3 + dps.messaging.exchange-name=notification dps.messaging.routing-key=CRRP