Skip to content
This repository was archived by the owner on Jun 16, 2021. It is now read-only.

Commit 378560c

Browse files
authored
Merge pull request #265 from Jonathan-hickey-cko/main
Upgrading AWS Package versions and Fixing SqsBatchedDispatcher delay
2 parents 65dd6eb + e296897 commit 378560c

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

src/OpenMessage.AWS.SNS/OpenMessage.AWS.SNS.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="AWSSDK.SimpleNotificationService" Version="3.5.0.29" />
9+
<PackageReference Include="AWSSDK.SimpleNotificationService" Version="3.7.0.9" />
1010
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="3.1.9" />
1111
</ItemGroup>
1212

src/OpenMessage.AWS.SQS/OpenMessage.AWS.SQS.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="AWSSDK.SQS" Version="3.5.0.28" />
9+
<PackageReference Include="AWSSDK.SQS" Version="3.7.0.9" />
1010
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="3.1.9" />
1111
</ItemGroup>
1212

src/OpenMessage.AWS.SQS/SqsBatchedDispatcher.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,13 @@ public override async Task DispatchAsync(Message<T> message, CancellationToken c
5656
{
5757
Id = Guid.NewGuid().ToString("N"),
5858
MessageAttributes = GetMessageProperties(message),
59-
DelaySeconds = DelaySeconds(message),
6059
MessageBody = json
6160
};
6261

62+
var delay = DelaySeconds(message);
63+
if (delay.HasValue)
64+
request.DelaySeconds = delay.Value;
65+
6366
var msg = new SendSqsMessageCommand
6467
{
6568
Message = request,
@@ -81,14 +84,14 @@ public override async Task DispatchAsync(Message<T> message, CancellationToken c
8184
}
8285
}
8386

84-
private static int DelaySeconds(Message<T> message)
87+
private static int? DelaySeconds(Message<T> message)
8588
{
8689
if (message is ISupportSendDelay delay && delay.SendDelay > TimeSpan.Zero)
8790
{
8891
return Math.Min(MaximumSqsDelaySeconds, (int) delay.SendDelay.TotalSeconds);
8992
}
9093

91-
return 0;
94+
return null;
9295
}
9396

9497
private Dictionary<string, MessageAttributeValue> GetMessageProperties(Message<T> message)

0 commit comments

Comments
 (0)