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..4f918a37 100644 --- a/src/spd-notification-worker/src/main/resources/application.properties +++ b/src/spd-notification-worker/src/main/resources/application.properties @@ -4,6 +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.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