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] Cannot send to ServiceBus Queue in state ReceiveDisabled

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
yvgopalcommented, Apr 17, 2020

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.

1reaction
SeanFeldmancommented, May 8, 2020

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to Queue a Message using "Microsoft.Azure. ...
I'm able to queue message to the same queue using BrokeredMessage from WindowsAzure.ServiceBus library. How can we queue a message when the ...
Read more >
Azure Service Bus - suspend messaging entities
This article explains how to temporarily suspend and reactivate Azure Service Bus message entities (queues, topics, and subscriptions).
Read more >
Azure Functions Service Bus Queue Trigger unhandled ...
As the documentation says ReceiveDisabled means, you can send messages to the queue, but you can't receive messages from it. You'll get an ......
Read more >
A Quick Way to Solve the Azure Service Bus Availability ...
Below are the most common reasons: The Queue may go Disabled/Send Disabled/Receive Disabled state; The Queue may accidentally get removed from ...
Read more >
Use Case - Monitoring Azure Service Bus
Article explaining the use cases for monitoring Azure Service Bus ... When the queue is in Disabled / Send disabled / Receive disabled...
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