question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Service Bus: Unable to set AutoDeleteOnIdle when ForwardDeadLetteredMessagesTo is set

See original GitHub issue

When 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:closed
  • Created 3 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
axisccommented, Feb 23, 2021

@Bubelgin We’re investigating this internally and will come back with our findings.

0reactions
yvgopalcommented, Mar 9, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Auto-deleteOnIdle: Service Bus App fails with err#404(Not ...
Cause: One of the properties that can be set on SB Queues or Topic-Subscriptions is Auto-delete on idle. Autodelete on idle enables you...
Read more >
Azure service bus subscription enable auto delete bicep
I am unable to find "Never auto delete" on the bicep specs above. The closest thing to it is "autoDeleteOnIdle" which is a...
Read more >
Microsoft Azure Service Bus Client for Golang
Microsoft Azure Service Bus is a reliable cloud messaging service (MaaS) which simplifies enterprise cloud messaging.
Read more >
Road To AZ-204 - Developing Message-Based Solution
Auto delete on idle, sets a time span to delete the queue if it is not used;; Duplicate detection history, before sending a...
Read more >
fengzijun/ServiceBusExplorer
That's why in June, I created a tool called Service Bus Explorer that allows a user to create, delete and test queues, topics,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found