Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Upgrade Azure Service Bus to 5.2.0 #47

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.ServiceBus" Version="3.2.1" />
<PackageReference Include="Microsoft.Azure.ServiceBus" Version="5.2.0" />
<PackageReference Include="StyleCop.Analyzers" PrivateAssets="All" Version="1.1.118" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public override async Task<IQueueMessage> DequeueAsync(
// This timeout is arbitrary. It is needed in order to return null
// if no messages are queued, and must be long enough to allow time
// for connection setup.
var message = await _messageReceiver.ReceiveAsync(TimeSpan.FromSeconds(10));
var message = await _messageReceiver.ReceiveAsync(TimeSpan.FromSeconds(5));
Copy link
Author

@HenryGaoE HenryGaoE Jan 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was necessary as 10 seconds was too long to return null if no messages were queued.
Based on a few tests, it was determined that 5 seconds consistently allows for null messages from empty queues to be picked up. After 6+ seconds, it was determined that it can prevent these null messages.

As stated in the comment, this is an arbitrary value and needs to be:

  1. Short enough to allow nulls
  2. Long enough to allow for connection setup.

All tests pass with this change. However, it's not possible to do local testing due to the need for Azure resources.
Therefore, I believe it's necessary to test the changes on Dev using the DealTrack API.


if (message == null)
{
Expand Down