From 33749a480c1381709d9d5494dd671b94e31f28e8 Mon Sep 17 00:00:00 2001 From: Aleksander Lund Date: Mon, 2 Oct 2023 23:13:56 +0200 Subject: [PATCH 1/3] Increasing the time of delay when retrying to process queued message (Provision) --- .../ServiceBus/QueueMessageProcessor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/function/Fusion.Resources.Functions/ServiceBus/QueueMessageProcessor.cs b/src/backend/function/Fusion.Resources.Functions/ServiceBus/QueueMessageProcessor.cs index 41b37c841..d6c93d34c 100644 --- a/src/backend/function/Fusion.Resources.Functions/ServiceBus/QueueMessageProcessor.cs +++ b/src/backend/function/Fusion.Resources.Functions/ServiceBus/QueueMessageProcessor.cs @@ -61,7 +61,7 @@ public async Task ProcessWithRetriesAsync(ServiceBusReceivedMessage message, Fun { var retryMessage = new ServiceBusMessage(message); retryCount++; - var interval = 10 * retryCount; + var interval = 60 * retryCount; var scheduledTime = DateTimeOffset.Now.AddSeconds(interval); retryMessage.ApplicationProperties["retry-count"] = retryCount; From 8c099c23dc809caf35eb0796d483d8c189abf066 Mon Sep 17 00:00:00 2001 From: Aleksander Lund Date: Tue, 3 Oct 2023 13:32:20 +0200 Subject: [PATCH 2/3] Added scheduleTime to retryMessage --- .../ServiceBus/QueueMessageProcessor.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/backend/function/Fusion.Resources.Functions/ServiceBus/QueueMessageProcessor.cs b/src/backend/function/Fusion.Resources.Functions/ServiceBus/QueueMessageProcessor.cs index d6c93d34c..f5f861646 100644 --- a/src/backend/function/Fusion.Resources.Functions/ServiceBus/QueueMessageProcessor.cs +++ b/src/backend/function/Fusion.Resources.Functions/ServiceBus/QueueMessageProcessor.cs @@ -66,6 +66,7 @@ public async Task ProcessWithRetriesAsync(ServiceBusReceivedMessage message, Fun retryMessage.ApplicationProperties["retry-count"] = retryCount; retryMessage.ApplicationProperties["original-SequenceNumber"] = originalSequence; + retryMessage.ScheduledEnqueueTime = scheduledTime; await sender.AddAsync(retryMessage); await receiver.CompleteMessageAsync(message); From eb2f568b2bcd8969b43b3b4ae606c36fbd285d76 Mon Sep 17 00:00:00 2001 From: aleklundeq <138589813+aleklundeq@users.noreply.github.com> Date: Tue, 10 Oct 2023 12:36:04 +0200 Subject: [PATCH 3/3] Update QueueMessageProcessor.cs Changed from 60 to 30 seconds delay per retry --- .../ServiceBus/QueueMessageProcessor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/function/Fusion.Resources.Functions/ServiceBus/QueueMessageProcessor.cs b/src/backend/function/Fusion.Resources.Functions/ServiceBus/QueueMessageProcessor.cs index f5f861646..83280465c 100644 --- a/src/backend/function/Fusion.Resources.Functions/ServiceBus/QueueMessageProcessor.cs +++ b/src/backend/function/Fusion.Resources.Functions/ServiceBus/QueueMessageProcessor.cs @@ -61,7 +61,7 @@ public async Task ProcessWithRetriesAsync(ServiceBusReceivedMessage message, Fun { var retryMessage = new ServiceBusMessage(message); retryCount++; - var interval = 60 * retryCount; + var interval = 30 * retryCount; var scheduledTime = DateTimeOffset.Now.AddSeconds(interval); retryMessage.ApplicationProperties["retry-count"] = retryCount;