[BUG] Service Bus: Unable to set AutoDeleteOnIdle when ForwardDeadLetteredMessagesTo is set
See original GitHub issueWhen creating or updating ServiceBus topic subscriptions AutoDeleteOnIdle setting will be ignored if ForwardDeadLetteredMessagesTo property is set.
Expecting the AutoDeleteOnIdle to be set no matter if ForwardDeadLetteredMessagesTo is set or not.
Sample code:
using System;
using System.Threading.Tasks;
using Microsoft.Azure.ServiceBus.Management;
namespace AutoDeleteOnIdle
{
class Program
{
static async Task Main(string[] args)
{
var connectionString = "your connection string here";
var managementClient = new ManagementClient(connectionString);
var topic = await managementClient.CreateTopicAsync("testtopic");
SubscriptionDescription subDescription = new SubscriptionDescription(topic.Path, "testsubscription")
{
AutoDeleteOnIdle = TimeSpan.FromHours(1),
ForwardDeadLetteredMessagesTo = "deadletterqueue"
};
await managementClient.CreateSubscriptionAsync(subDescription);
}
}
}
If the line with “ForwardDeadLetteredMessagesTo” is removed everything works as expected.
Environment:
- Name and version of the Library package used: Microsoft.Azure.ServiceBus 5.1.1 - older versions seem to have the same behavior.
- Hosting platform or OS and .NET runtime version: Azure ServiceBus, test project .net core 3.1 console application dotnet --info .NET SDK (reflecting any global.json): Version: 5.0.101 Commit: d05174dc5a
Runtime Environment: OS Name: Windows OS Version: 10.0.18363 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\5.0.101\
Host (useful for support): Version: 5.0.1 Commit: b02e13abab
.NET SDKs installed: 2.1.801 [C:\Program Files\dotnet\sdk] 2.2.401 [C:\Program Files\dotnet\sdk] 2.2.402 [C:\Program Files\dotnet\sdk] 3.0.100-preview8-013656 [C:\Program Files\dotnet\sdk] 3.1.101 [C:\Program Files\dotnet\sdk] 3.1.201 [C:\Program Files\dotnet\sdk] 5.0.100 [C:\Program Files\dotnet\sdk] 5.0.101 [C:\Program Files\dotnet\sdk]
.NET runtimes installed: Microsoft.AspNetCore.All 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.0.0-preview8.19405.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.0.0-preview8-28405-07 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.0.0-preview8-28405-07 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
- IDE and version : Visual Studio 16.8.3
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (3 by maintainers)
Top GitHub Comments
@Bubelgin We’re investigating this internally and will come back with our findings.
This is not an SDK bug. All SDKs behave the same because ServiceBus service would ignore AutoDeleteOnIdle if ForwardTo or ForwardDeadletterMessagesTo is set on any entity.
It is not a recent change either. Service Bus has always ignored AutoDeleteOnIdle if the entity is set to forward messages to another entity. Having said that, I don’t know the exact reason why that decision was made. I see that some of you have a justification why AutoDeleteOnIdle shouldn’t be ignored. Please raise a request to the service. Our PM team will either provide an answer or take it up a a feature request.
I am closing this issue as it is not SDK specific issue.