Azure-sdk-for-net: [BUG] Cannot send to ServiceBus Queue in state ReceiveDisabled

Created on 11 Mar 2020  ·  9Comments  ·  Source: Azure/azure-sdk-for-net

Describe the bug
From this SO question.

When you set a ServiceBus queue to ReceiveDisabled you cannot send messages to it using the .NET SDK. You get the error

Microsoft.Azure.ServiceBus.MessagingEntityDisabledException: 'Messaging entity 'sb://xxx.servicebus.windows.net/xxxx' is currently disabled.

If you put it to SendDisabled you get the correct error:

Microsoft.Azure.ServiceBus.MessagingEntityDisabledException: 'Messaging entity 'xxxxx:Queue:demofunctionqueue' is currently disabled for Send operations.

Expected behavior
In state ReceiveDisabled you should still be able to send messages as stated here

Actual behavior (include Exception or Stack Trace)
See above.

Interesting fact: In ServiceBusExplorer I still can send a message in state ReceiveDisabled. So there might be a SDK issue here rather than an issue in SB itself.

//Edit: It also works correctly when I use the REST API (using Postman) and SAS token.

To Reproduce
````
var cs = "Endpoint=sb://...";
var queueName = "demofunctionqueue";

        var serviceBusManagementClient = new ManagementClient(cs);
        var queues = await serviceBusManagementClient.GetQueuesAsync();
        foreach (var queueItem in queues)
        {
            Console.WriteLine($"Disabling {queueItem.Path}");
            queueItem.Status = EntityStatus.ReceiveDisabled;
            await serviceBusManagementClient.UpdateQueueAsync(queueItem);
        } 

        var messageSender = new MessageSender(cs, queueName);
        var message = new Message(Encoding.UTF8.GetBytes("hello"));
        await messageSender.SendAsync(message);

````

Environment:

  • .NET Core 3.1

    • Microsoft.Azure.ServiceBus 4.1.2

Client Service Attention Service Bus

Most helpful comment

This is service bug. Just fixed. It will be rolled out to production over the next month. We have reduced the frequency of deployments during this COVID-19 lockdown.

All 9 comments

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @jfggdl.

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @jfggdl.

Isn't this a broker issue, i.e. https://github.com/Azure/azure-service-bus/

I haven’t tried any other SDK, but since plain http is working correctly, it might be, yes.
Is there an easy way to move an issue to a different repo?

Yeah we will have to evaluate if its a client side issue or backend. Thanks for reporting this. We will investigate and get back to you..

Any update on this? Thanks!

This is service bug. Just fixed. It will be rolled out to production over the next month. We have reduced the frequency of deployments during this COVID-19 lockdown.

@yvgopal By service bug do you mean that we need to update the client library or not? And in that case which client and version will the fix be in?

@Magnus12 I think what it means is that there shouldn't be any client change. The broker/back-end/service-side is patched and the client SDK will just work.

Was this page helpful?
0 / 5 - 0 ratings