[BUG] Cannot send to ServiceBus Queue in state ReceiveDisabled
See original GitHub issueDescribe 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:
- Created 4 years ago
- Comments:9 (6 by maintainers)
Top GitHub Comments
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.
@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.